2017-02-10 57 views
0

我可以使用Azure AD登錄並行數據庫登錄到我的Web應用程序使用JAAS嗎?我已經創建了蔚藍色的門戶Web應用程序和使用本此代碼試圖登錄:https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/dev/src/samples/public-client-app-sample/src/main/java/PublicClient.javaAzure AD使用JAAS

但我面對像

The request body must contain the following parameter: 'client_secret or client_assertion'.\r\nTrace ID: fd0sxdac-72a3-4ac2-9aca-02aa64bb8ef5\r\nCorrelation ID: 96xsdb2c-864e-4325-b8cb-98fb6d6ab541\r\nTimestamp: 2017-02-10 13:30:02Z","error":"invalid_client"} at com.microsoft.aad.adal4j.AdalTokenRequest.executeOAuthRequestAndProcessResponse(AdalTokenRequest.java:108)

問題,我改變了我的應用程序,以本機應用程序,並試圖再次登錄,但這次我最終得到這個錯誤:

com.microsoft.aad.adal4j.AuthenticationException: {"error_description":"AADSTS65001: The user or administrator has not consented to use the application with ID '7xxxyyy9-bcf6-4uu1-bzzz6-d279189ea7bf'. Send an interactive authorization request for this user and resource.\r\nTrace ID: cbd15f8a-983b-469f-9e20-bf0c8eee4e0c\r\nCorrelation ID: 213bb116-3617-4b89-8170-a123e072bfb5\r\nTimestamp: 2017-02-10 15:32:12Z","error":"invalid_grant"} at com.microsoft.aad.adal4j.AdalTokenRequest.executeOAuthRequestAndProcessResponse(AdalTokenRequest.java:108)

我已經添加了所需的權限使用Microsoft圖(登錄和讀取用戶配置文件)的應用程序,但仍然無法正常工作。如果你們中的一個人能指引我朝着正確的方向,我會非常感激。

回答

0

實際上找出答案,我只需在應用程序上授予相關權限並開始工作。