#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.ScopeManagement](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ScopeManagement '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\.

```csharp
public static class ScopeManagerExtensions
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → ScopeManagerExtensions
### Methods

## ScopeManagerExtensions\.Validate\(this IScopeManager, IEnumerable\<string\>, ResourceDefinition\[\], string\[\], ScopeDefinition\[\], string\) Method {#Abblix.Oidc.Server.Features.ScopeManagement.ScopeManagerExtensions.Validate(thisAbblix.Oidc.Server.Features.ScopeManagement.IScopeManager,System.Collections.Generic.IEnumerable_string_,Abblix.Oidc.Server.Common.Constants.ResourceDefinition[],string[],Abblix.Oidc.Server.Common.Constants.ScopeDefinition[],string)}

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\.

```csharp
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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ScopeManagement.IScopeManager 'Abblix\.Oidc\.Server\.Features\.ScopeManagement\.IScopeManager') {#Abblix.Oidc.Server.Features.ScopeManagement.ScopeManagerExtensions.Validate(thisAbblix.Oidc.Server.Features.ScopeManagement.IScopeManager,System.Collections.Generic.IEnumerable_string_,Abblix.Oidc.Server.Common.Constants.ResourceDefinition[],string[],Abblix.Oidc.Server.Common.Constants.ScopeDefinition[],string).scopeManager}

The scope manager that maintains the definitions of scopes\.

###### `scopes` [System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1') {#Abblix.Oidc.Server.Features.ScopeManagement.ScopeManagerExtensions.Validate(thisAbblix.Oidc.Server.Features.ScopeManagement.IScopeManager,System.Collections.Generic.IEnumerable_string_,Abblix.Oidc.Server.Common.Constants.ResourceDefinition[],string[],Abblix.Oidc.Server.Common.Constants.ScopeDefinition[],string).scopes}

A collection of scope identifiers to be validated\.

###### `resources` [ResourceDefinition](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.ResourceDefinition 'Abblix\.Oidc\.Server\.Common\.Constants\.ResourceDefinition')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Oidc.Server.Features.ScopeManagement.ScopeManagerExtensions.Validate(thisAbblix.Oidc.Server.Features.ScopeManagement.IScopeManager,System.Collections.Generic.IEnumerable_string_,Abblix.Oidc.Server.Common.Constants.ResourceDefinition[],string[],Abblix.Oidc.Server.Common.Constants.ScopeDefinition[],string).resources}

An optional array of [ResourceDefinition](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.ResourceDefinition 'Abblix\.Oidc\.Server\.Common\.Constants\.ResourceDefinition') objects to validate scopes
            against\.

###### `allowedClientScopes` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Oidc.Server.Features.ScopeManagement.ScopeManagerExtensions.Validate(thisAbblix.Oidc.Server.Features.ScopeManagement.IScopeManager,System.Collections.Generic.IEnumerable_string_,Abblix.Oidc.Server.Common.Constants.ResourceDefinition[],string[],Abblix.Oidc.Server.Common.Constants.ScopeDefinition[],string).allowedClientScopes}

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](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.ScopeDefinition 'Abblix\.Oidc\.Server\.Common\.Constants\.ScopeDefinition')[\[\]](https://learn.microsoft.com/en-us/dotnet/api/system.array 'System\.Array') {#Abblix.Oidc.Server.Features.ScopeManagement.ScopeManagerExtensions.Validate(thisAbblix.Oidc.Server.Features.ScopeManagement.IScopeManager,System.Collections.Generic.IEnumerable_string_,Abblix.Oidc.Server.Common.Constants.ResourceDefinition[],string[],Abblix.Oidc.Server.Common.Constants.ScopeDefinition[],string).scopeDefinitions}

Outputs an array of [ScopeDefinition](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.ScopeDefinition 'Abblix\.Oidc\.Server\.Common\.Constants\.ScopeDefinition') objects if
            the validation is successful, otherwise null\.

###### `errorDescription` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.ScopeManagement.ScopeManagerExtensions.Validate(thisAbblix.Oidc.Server.Features.ScopeManagement.IScopeManager,System.Collections.Generic.IEnumerable_string_,Abblix.Oidc.Server.Common.Constants.ResourceDefinition[],string[],Abblix.Oidc.Server.Common.Constants.ScopeDefinition[],string).errorDescription}

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

#### Returns
[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')  
True if all requested scopes are valid and permissible, false otherwise\.
