在 Postman 中为 Azure AD B2C 请求访问令牌令牌、中为、Postman、Azure

2023-09-07 10:21:14 作者:醉江南

如何在

我尝试从 Azure 门户中的 Run Now 获取 url 并将其放入 Auth Url 中,但这会产生以下错误:

Azure AD

更新

按照克里斯的回答,我现在已经克服了上述错误.我可以登录,但仍然无法获得访问令牌:

AADB2C90085:服务遇到内部错误.请重新验证并重试.相关 ID:45c56d47-4739-465f-8e02-49ba5b3a1b86时间戳:2017-11-16 15:27:52Z

解决方案

使用 @Chris Padgett 的回答,我能够使用 Implicit 授权类型使其工作(无法使用授权代码格兰类型使其工作).

授权类型:隐式

回调 URL:我的 B2C 应用中定义的任何 URL

身份验证网址:https://login.microsoftonline.com/te/{tenant}/{policy}/oauth2/v2.0/authorize

客户端 ID:Application ID 来自我的 B2C 应用

范围:https://{tenant}.onmicrosoft.com/{web api app id uri}/{scope name}

客户端认证:随便哪一个都无所谓

How can I request an Access Token in Postman against an Azure AD B2C tenant?

I tried taking the url from Run Now in the Azure portal and putting that in the Auth Url but that produces the following error:

Update

Following Chris's answer, I'm now past the above error. I'm able to sign-in but still can't get an access token:

AADB2C90085: The service has encountered an internal error. Please reauthenticate and try again. Correlation ID: 45c56d47-4739-465f-8e02-49ba5b3a1b86 Timestamp: 2017-11-16 15:27:52Z

解决方案

Using @Chris Padgett's answer, I was able to get it working using the Implicit Grant Type (couldn't get it working w/ Authorization Code Gran Type).

Grant Type: Implicit

Callback URL: any URL defined in my B2C app

Auth URL: https://login.microsoftonline.com/te/{tenant}/{policy}/oauth2/v2.0/authorize

Client ID: Application ID from my B2C app

Scope: https://{tenant}.onmicrosoft.com/{web api app id uri}/{scope name}

Client Authentication: Either one, it didn't matter