Skip to content

ScopeDefinition Class

Defines a structure for OAuth 2.0 scope definitions, specifying the scope and associated claim types.

C#
public record ScopeDefinition : System.IEquatable<Abblix.Oidc.Server.Common.Constants.ScopeDefinition>

Inheritance System.Object → ScopeDefinition

Implements System.IEquatable<ScopeDefinition>

Remarks

The properties are settable and a parameterless constructor is available so that a definition can be read from configuration. A configuration binder builds a positional record through its constructor, and it drops an element outright when a constructor parameter of collection type is absent or empty from the source - which is exactly the shape of a resource scope that carries no claims. Building the instance and then assigning its properties has no such blind spot.

Constructors

ScopeDefinition() Constructor

Initializes an empty definition, to be completed through its properties.

C#
public ScopeDefinition();

ScopeDefinition(string, string[]) Constructor

Initializes a definition for the given scope and the claims it asks for.

C#
public ScopeDefinition(string scope, params string[] claimTypes);

Parameters

scope System.String

The name of the scope as it appears on the wire.

claimTypes System.String[]

The claims this scope requests, if any.

Properties

ScopeDefinition.ClaimTypes Property

The claims this scope requests. An empty set is meaningful: a scope that authorizes access to a resource has nothing to say about the user.

C#
public string[] ClaimTypes { get; set; }

Property Value

System.String[]

ScopeDefinition.Scope Property

The name of the scope as it appears on the wire.

C#
public string Scope { get; set; }

Property Value

System.String

Methods

ScopeDefinition.Deconstruct(string, string[]) Method

Deconstructs the definition into its scope and claim types.

C#
public void Deconstruct(out string scope, out string[] claimTypes);

Parameters

scope System.String

Receives Scope.

claimTypes System.String[]

Receives ClaimTypes.