我在嘗試構建一個簡單的Ruby應用程序,它可以連接到Microsoft Graph API並獲取有關用戶的基本信息,例如經理或直接報告。Microsoft Graphs scopes v2 oauth
我跟着0365教程,我有一個可以獲取用戶郵件的工作應用程序。然而,當我試圖然後使用會話令牌來查詢圖形API,我得到一個錯誤:
response.body
=> "{\r\n \"error\": {\r\n \"code\": \"InvalidAuthenticationToken\",\r\n \"message\": \"Access token validation failure.\",\r\n \"innerError\": {\r\n \"request-id\": \"18cbc6be-5254-400c-9780-7427376587fb\",\r\n \"date\": \"2016-06-30T22:21:55\"\r\n }\r\n }\r\n}"
我使用範圍
SCOPES = [ 'openid', 'profile', 'https://outlook.office.com/contacts.read', 'offline_access' ]
我剛剛被提出,包括範圍「https://graph.microsoft.com/user.read」,但是當我加入這個到應用程序甚至打到用戶登錄頁面之前,我得到以下錯誤:
AADSTS70011: The provided value for the input parameter 'scope' is not valid. The scope openid profile offline_access https://graph.microsoft.com/user.read is not valid.
任何幫助,將不勝感激!
您能發佈您用於訪問登錄頁面的完整URL嗎? –
https://login.microsoftonline.com – Lievcin
我的意思是所有的參數:)。當出現錯誤時,您可以從瀏覽器複製它。 –