About oid claim从 azureAD 的访问 token /ID token 解码:
.... This ID uniquely identifies the user across applications - two different applications signing in the same user will receive the same value in the oid claim. ... Note that if a single user exists in multiple tenants, the user will contain a different object ID in each tenant - they're considered different accounts, even though the user logs into each account with the same credentials. ...
About id
从 microsoft graph api 的 /me
获取:
The unique identifier for the user.
以前,我的一个应用程序使用 id token 中的 oid
作为 azure 用户的 ID。
现在,我想出于相同的目的更新和使用图 api 的 id
。所以:
- 这两个 id(
oid
和id
)是否相同?那么我可以用id
替换oid
吗? - 从
/me
获取的id
对于“每个租户”来说是否不同,如上面的oid
描述?
最佳答案
是的,oid 和 id 应该相同,至少对于 AAD 用户来说是这样。
但您作为成员的每个 AAD 租户的情况都不同。它全局唯一标识特定的用户对象,每个用户对象在每个租户中都是独立的。
可以通过应用程序注册中的 token 配置 Blade 包含“主租户 oid”。 这将是用户在其主租户(即创建用户的租户)中的 oid。
关于oauth-2.0 - microsoft oidc id token 的 oid 声明是否与我从 microsoft graph api 获得的 id 相同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60170062/