Skip to main content

ScopeManagerExtensions Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Features.ScopeManagement

ScopeManagerExtensions Class

Provides extension methods for scope validation, leveraging a scope manager and resource definitions to ensure the validity and permissibility of requested scopes.

public static class ScopeManagerExtensions

Inheritance System.Object → ScopeManagerExtensions

Methods

ScopeManagerExtensions.Validate(this IScopeManager, IEnumerable<string>, ResourceDefinition[], string[], ScopeDefinition[], string) Method

Validates the requested scopes against registered scope definitions and resource definitions to confirm their validity and authorization. This method ensures that scopes are either recognized by the scope manager or included in the resource definitions.

public static bool Validate(this Abblix.Oidc.Server.Features.ScopeManagement.IScopeManager scopeManager, System.Collections.Generic.IEnumerable<string> scopes, Abblix.Oidc.Server.Common.Constants.ResourceDefinition[]? resources, string[]? allowedClientScopes, out Abblix.Oidc.Server.Common.Constants.ScopeDefinition[] scopeDefinitions, out string errorDescription);

Parameters

scopeManager IScopeManager

The scope manager that maintains the definitions of scopes.

scopes System.Collections.Generic.IEnumerable<System.String>

A collection of scope identifiers to be validated.

resources ResourceDefinition[]

An optional array of ResourceDefinition objects to validate scopes against.

allowedClientScopes System.String[]

The scopes the requesting client is allowed to request (its registered scope set). When non-empty, any requested scope outside this set is rejected. When null or empty, no per-client restriction is applied. Mirrors the per-issuer allow-list used by the JWT bearer grant.

scopeDefinitions ScopeDefinition[]

Outputs an array of ScopeDefinition objects if the validation is successful, otherwise null.

errorDescription System.String

Outputs a string describing the reason for validation failure, otherwise null if the validation is successful.

Returns

System.Boolean
True if all requested scopes are valid and permissible, false otherwise.