在 Postman 中授权 AzureAD 时如何获取 v2 jwt 令牌 [英] How to get a v2 jwt token when authorizing against AzureAD in Postman

查看:28
本文介绍了在 Postman 中授权 AzureAD 时如何获取 v2 jwt 令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够获得

解决方案

首先我们需要在任何组织目录(任何 Azure AD 目录 - 多租户)和个人目录中创建具有支持的帐户类型"作为 帐户的广告中的应用程序Microsoft 帐户(例如 Skype、Xbox).(当我们选择此选项时,其 Manifest 中的属性 accessTokenAcceptedVersion 将为 2).

然后我们需要在里面添加一个作用域,当我们请求访问令牌的时候,我们需要使用openid api://xxxxxx/User.read 而不是仅仅openid 在邮递员中作为您提供的屏幕截图.

之后,我们可以请求访问令牌(v2)

解析访问令牌,它将显示 v2.

关于如何添加范围的更新:

我们可以在门户的应用程序中添加范围(如下图所示):

然后我们可以直接从这里复制作用域,如下所示:

I'm able to get a v1.0 jwt token with the below settings.

How do I make the https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize endpoint return v2.0?

解决方案

First we need to create app in ad with "Supported account types" as Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).(when we choose this option, the property accessTokenAcceptedVersion in its Manifest will be 2).

Then we need to add a scope in it, and when we request the access token, we need to use openid api://xxxxxx/User.read instead of only openid in postman as the screenshot you provided.

After that, we can request the access token(v2)

Parse the access token, it will show v2.

Update about how to add scope:

We can add the scope in app on portal(shown as screenshot below):

Then we can copy the scope directly from here as below:

这篇关于在 Postman 中授权 AzureAD 时如何获取 v2 jwt 令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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