无法在Azure门户进行身份验证

时间:2019-03-07 14:41:35

标签: java azure adal

我已使用https://github.com/satalyst/powerbi-rest-java在azure门户进行身份验证以将power bi报告嵌入到我的应用程序中。

有一个名为Office365Authenticator的类,我曾使用其凭据进行身份验证。我提供了

  1. client id =“ 3b54c59c-2602-4100-b4e5-xxxxxxxxxxxx”(我想是Azure门户上的应用程序ID)
  2. 租户id =“ b3e3ea8a-1379-4a80-acdd-xxxxxxxxxxxx”(目录ID)
  3. 用户名(azure门户登录电子邮件)
  4. 密码(azure门户登录密码)

    Office365Authenticator广告=新的Office365Authenticator(CLIENT_ID,TENANT,USERNAME,PASSWORD);

但是会引发错误

{"error":"invalid_request","error_description":"AADSTS90019: No tenant-identifying information found in either the request or implied by any provided credentials.\r\nTrace ID: 948699d9-0f5d-4dd8-af3d-xxxxxxxxxxxx\r\nCorrelation ID: 27a9bdc9-90c1-4b40-9fe8-xxxxxxxxxxxx\r\nTimestamp: 2019-03-07 14:27:04Z"}

我进行了搜索,但是没有确切的线索,当我确认租户ID正确并且用户与此租户ID相关联时,在我的情况下会发生这种情况。

enter image description here

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

要使用ROPC(用户名和密码),您应该具有以下参数:

1. client_id: your application id in the azure portal
2. client_secret: you could create this key in the application
3. grant_type:password
4. username: the user account that you want in the azure portal
5. password: the password for your account
6. scope: https://graph.microsoft.com/User.Read email openid(here use the microsoft graph api as an example, and the related permissions: User.Read, email, openid)

有关详细信息,请参阅here