public static AuthorizationPolicyBuilder RequireScope( this AuthorizationPolicyBuilder authorizationPolicyBuilder, string requiredScope) { authorizationPolicyBuilder.RequireScopes(NonEmptyList.Create(requiredScope)); return(authorizationPolicyBuilder); }
public void MultiScopeRegistrationTest() { const string openIdScope = "openid"; const string profileScope = "profile"; var builder = new AuthorizationPolicyBuilder(); builder.RequireScopes(NonEmptyList.Create(openIdScope, profileScope)); var requiredScopes = ((ScopeAuthorizationRequirement)builder.Requirements.ToList()[0]).RequiredScopes.ToList(); Assert.Contains(openIdScope, requiredScopes); Assert.Contains(profileScope, requiredScopes); }