404 Not Found error via resource owner password credentials flow in Azure AD B2C

大兔子大兔子 提交于 2019-12-11 17:32:26

问题


I got the error below after following the example below: https://docs.microsoft.com/en-gb/azure/active-directory-b2c/configure-ropc

HTTP/1.1 404 Not Found
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/10.0
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

I use a outlook account, e.g. myname@outlook.com, with global admin role to follow the example, but got the error above.

Below is the code from the example:

This link below return result form web browser:

https://mytenant.b2clogin.com/mytenant.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1_ROPC_Auth

Test the user flow via Fiddler

https://mytenant.b2clogin.com/mytenant.onmicrosoft.com/oauth2/v2.0/token?B2C_1_ROPC_Auth

Content-Type: application/x-www-form-urlencoded
username=myname@outlook.com&password=mypassword&grant_type=password&scope=openid myappId offline_access&client_id=myappId&response_type=token+id_token

Any idea?


回答1:


You must ensure you are including the p= query parameter in the token request:

https://mytenant.b2clogin.com/mytenant.onmicrosoft.com/oauth2/v2.0/token?p=B2C_1_ROPC_Auth



来源:https://stackoverflow.com/questions/54496543/404-not-found-error-via-resource-owner-password-credentials-flow-in-azure-ad-b2c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!