Class PoliciesBuilderExtensions
- Namespace
- Keycloak.AuthServices.Authorization
- Assembly
- Keycloak.AuthServices.Authorization.dll
public static class PoliciesBuilderExtensions
- Inheritance
-
PoliciesBuilderExtensions
- Inherited Members
Methods
RequireProtectedResource(AuthorizationPolicyBuilder, string, string)
Adds protected resource requirement to builder. Makes outgoing HTTP requests to Authorization Server.
public static AuthorizationPolicyBuilder RequireProtectedResource(this AuthorizationPolicyBuilder builder, string resource, string scope)
Parameters
builder
AuthorizationPolicyBuilderresource
stringscope
string
Returns
RequireProtectedResource(AuthorizationPolicyBuilder, string, string[], ScopesValidationMode?)
Adds protected resource requirement to builder. Makes outgoing HTTP requests to Authorization Server.
public static AuthorizationPolicyBuilder RequireProtectedResource(this AuthorizationPolicyBuilder builder, string resource, string[] scopes, ScopesValidationMode? scopesValidationMode = null)
Parameters
builder
AuthorizationPolicyBuilderresource
stringscopes
string[]scopesValidationMode
ScopesValidationMode?
Returns
RequireRealmRoles(AuthorizationPolicyBuilder, params string[])
Adds realm role requirement to builder. Ensures that at least one realm role is present in realm claims.
public static AuthorizationPolicyBuilder RequireRealmRoles(this AuthorizationPolicyBuilder builder, params string[] roles)
Parameters
builder
AuthorizationPolicyBuilderroles
string[]
Returns
RequireResourceRoles(AuthorizationPolicyBuilder, params string[])
Adds resource role requirement to builder. Ensures that at least one resource role is present in resource claims. Note, make sure role source is configure. See documentation for more details.
public static AuthorizationPolicyBuilder RequireResourceRoles(this AuthorizationPolicyBuilder builder, params string[] roles)
Parameters
builder
AuthorizationPolicyBuilderroles
string[]
Returns
RequireResourceRolesForClient(AuthorizationPolicyBuilder, string, string[])
Adds resource role requirement to builder. Ensures that at least one resource role is present in resource claims.
public static AuthorizationPolicyBuilder RequireResourceRolesForClient(this AuthorizationPolicyBuilder builder, string client, string[] roles)
Parameters
builder
AuthorizationPolicyBuilderclient
stringroles
string[]