Azure AD B2C中的Access_denied访问的资源所有者密码凭据流

问题描述 投票:0回答:2

我在下面关注了这篇文章,但是从“测试用户流程”部分得到了以下错误:

https://docs.microsoft.com/en-gb/azure/active-directory-b2c/configure-ropc

HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/10.0
x-ms-gateway-requestid: fd437d7a-fd0e-42bf-adcf-0969f5dcf74d
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Set-Cookie: x-ms-cpim-trans=; domain=mytenant.b2clogin.com; expires=Tue, 29-Jan-2019 13:35:09 GMT; path=/; secure; HttpOnly
Date: Wed, 30 Jan 2019 13:35:08 GMT
Content-Length: 217

{"error":"access_denied","error_description":"AADB2C90225: The username or password provided in the request are invalid.\r\nCorrelation ID: 9b3c19e2-6084-4bcd-b7d3-aab8d2c34dd9\r\nTimestamp: 2019-01-30 13:35:09Z\r\n"}

已发送请求:

POST https://mytenant.b2clogin.com/mytenant.onmicrosoft.com/oauth2/v2.0/token?p=B2C_1_ROPC_Auth HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: mytenant.b2clogin.com

username=myemail&password=password&grant_type=password&scope=openid myappId offline_access&client_id=myappId&response_type=token+id_token

我是全局管理员,但是我可以创建用户流程,注册应用程序等。>

我正在使用Fiddler发送请求,因此它与WebApp / WebAPI无关。

用户名(例如,myname @ myfirm.com)和密码正确,用于登录Azure门户以设置示例。

任何想法?

更新

[请注意,我使用的用户是我公司活动目录中的用户角色,但该用户是活动目录中的全局管理员,与https://docs.microsoft.com/en-gb/azure/active-directory-b2c/tutorial-create-tenant之后新创建的AD B2C租户相关联>

[我在下面关注了这篇文章,但是从“测试用户流”部分得到了以下错误:https://docs.microsoft.com/zh-CN/azure/active-directory-b2c/configure-ropc HTTP / 1.1 400错误的请求缓存-...

azure azure-active-directory azure-ad-b2c
2个回答
1
投票

the Configure the resource owner password credentials flow in Azure AD B2C article描述的资源所有者密码凭据流并非旨在验证管理员用户的凭据。

它旨在为已经(a)被created as a local account using the Azure AD Graph API或(b)使用注册流程注册自己的最终用户认证证书。


1
投票

基本上,如果您遵循文档here。您会收到此错误消息,因为步骤4中的指令有误。

© www.soinside.com 2019 - 2024. All rights reserved.