Class OrganizationRequirement
- Namespace
- Keycloak.AuthServices.Authorization.Requirements
- Assembly
- Keycloak.AuthServices.Authorization.dll
Authorization requirement that validates the user's membership in a Keycloak organization.
public class OrganizationRequirement : IAuthorizationRequirement, IAuthorizationRequirementData
- Inheritance
-
OrganizationRequirement
- Implements
- Inherited Members
Constructors
OrganizationRequirement()
Constructs requirement that checks for any organization membership.
public OrganizationRequirement()
OrganizationRequirement(string)
Constructs requirement that checks for membership in a specific organization.
public OrganizationRequirement(string organization)
Parameters
organizationstringThe organization alias, id, or route template (e.g., "{orgId}").
Fields
OrganizationPolicy
Internal name for the organization policy.
public const string OrganizationPolicy = "$OrganizationPolicy"
Field Value
Properties
Organization
Gets the organization alias or route template to check membership against.
When null, any organization membership satisfies the requirement.
Supports {param} route templates that are resolved at evaluation time.
public string? Organization { get; }
Property Value
ResolverType
Gets the type of IParameterResolver used to resolve organization template parameters.
When null, the default RouteParameterResolver is used.
public Type? ResolverType { get; init; }
Property Value
Methods
GetRequirements()
Returns IAuthorizationRequirement that should be satisfied for authorization.
public IEnumerable<IAuthorizationRequirement> GetRequirements()
Returns
- IEnumerable<IAuthorizationRequirement>
IAuthorizationRequirement used for authorization.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.