2017-02-10 58 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

实际上找出答案,我只需在应用程序上授予相关权限并开始工作。