C# 使用_claim_sources检索组声明返回指定的api版本无效。该值必须与支持的版本完全匹配
我想从Azure Active Directory检索已登录用户的组声明。我已在Azure Portal的应用程序清单中启用组检索C# 使用_claim_sources检索组声明返回指定的api版本无效。该值必须与支持的版本完全匹配,c#,asp.net-core,azure-active-directory,openid-connect,claims-based-identity,C#,Asp.net Core,Azure Active Directory,Openid Connect,Claims Based Identity,我想从Azure Active Directory检索已登录用户的组声明。我已在Azure Portal的应用程序清单中启用组检索 "groupMembershipClaims": "All" 组的数量超过了限制,我得到了以下声明: _claim_names: {"groups":"src1"} _claim_sources: {"src1":{"endpoint":"https://graph.windows.net/12345678-0939-496d-b129-198edd916fe
"groupMembershipClaims": "All"
组的数量超过了限制,我得到了以下声明:
_claim_names: {"groups":"src1"}
_claim_sources: {"src1":{"endpoint":"https://graph.windows.net/12345678-0939-496d-b129-198edd916feb/users/{user-object-guid}/getMemberObjects"}}
但是,当我向声明中指定的端点发出POST请求时,我得到:
{
"odata.error": {
"code": "Request_DataContractVersionMissing",
"message": {
"lang": "en",
"value": "The specified api-version is invalid. The value must exactly match a supported version."
}
}
}
如何正确申请团体索赔?我可以使用,但它需要额外的权限,为什么声明中会有另一个URI。您应该将
?api版本=1.6
附加到端点。查看完整的代码示例。现在,我得到了您的访问令牌已过期。请在提交请求之前续订。
,但我会在登录后立即执行请求。这怎么可能?uri中的第一个guid是什么?请确保您正在为graph.windows.net(Azure AD API)而不是graph.microsoft.com(microsoft graph API)获取令牌。请参阅,URI中的GUID表示您的域。您可以在Portal.Azure.com>Azure Active Directory>属性中看到它。GUID在那里。