【发布时间】:2019-02-07 21:35:27
【问题描述】:
当收到授权的 POST 请求时,我将证明令牌的声明。你在下面找到我的代码。我在每一行都设置了断点。但是从线
` policy.RequireAssertion(context =>`
编译器直接跳转到方法的末尾。 在我做这个证明之前我需要一些其他的东西还是我需要改变语法。 得到帮助会很高兴。 弗兰克
` services.AddAuthorization(configure =>
{
configure.AddPolicy("AccessControllerClaimGroupGUIDPolic", policy =>
{
policy.RequireAssertion(context =>
{
return context.User.HasClaim(c =>
{
return (c.Type == "groups" && AllowedClaimsGroupIds.Contains(c.Value)) || (c.Type == "http://schemas.microsoft.com/identity/claims/objectidentifier" && AllowedClaimsOId.Contains(c.Value));
});
});
});
});`
【问题讨论】:
标签: azure-active-directory asp.net-core-webapi policy