使用 Microsoft Identity 为 Graph 和 Azure DevOps API 获取唯一令牌
Acquire a unique token for both Graph and Azure DevOps APIs using Microsoft Identity
是否可以使用相同的访问令牌对 Microsoft Graph API 和 Azure DevOps API 进行身份验证?
当我对 Graph 进行身份验证并为 Azure DevOps 添加范围时,该令牌适用于 Azure DevOps,但对 Graph 停止工作。
谢谢!
不,不可能。
得到jwt(JSON Web Token) with OAuth 2.0 flow, every token just have one audience, it means one token is just for one resource, it can just call one kind of api. You could decode your token in https://jwt.io/,看到aud
,应该是devops的资源,要调用Microsoft Graph,应该是https://graph.microsoft.com
.
是否可以使用相同的访问令牌对 Microsoft Graph API 和 Azure DevOps API 进行身份验证?
当我对 Graph 进行身份验证并为 Azure DevOps 添加范围时,该令牌适用于 Azure DevOps,但对 Graph 停止工作。
谢谢!
不,不可能。
得到jwt(JSON Web Token) with OAuth 2.0 flow, every token just have one audience, it means one token is just for one resource, it can just call one kind of api. You could decode your token in https://jwt.io/,看到aud
,应该是devops的资源,要调用Microsoft Graph,应该是https://graph.microsoft.com
.