通过资源所有者密码凭据流在Azure AD B2C中出现404找不到错误 [英] 404 Not Found error via resource owner password credentials flow in Azure AD B2C

查看:72
本文介绍了通过资源所有者密码凭据流在Azure AD B2C中出现404找不到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在遵循以下示例后,出现以下错误: https://docs.microsoft.com/zh- gb/azure/active-directory-b2c/configure-ropc

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.

我使用一个Outlook帐户,例如myname@outlook.com,具有全局管理员角色,可以按照示例进行操作,但是出现了以上错误.

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

下面是示例代码:

下面的链接返回Web浏览器的结果表格:

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

通过Fiddler测试用户流

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

有什么主意吗?

推荐答案

您必须确保在令牌请求中包括p=查询参数:

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

这篇关于通过资源所有者密码凭据流在Azure AD B2C中出现404找不到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆