Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Authentication.dll Namespace: Microsoft.OData.Mcp.Authentication.Outbound Inheritance: System.Object

Syntax

Summary

Resolves the space-delimited OAuth scope a token request should ask for, per step 8 of the discovery algorithm and matching the SDK 2.2 ScopeSelectorDelegate order exactly.

Remarks

Per Key Decision 9 of specs/v3/AUTHENTICATION.md, the base scope order is: the WWW-Authenticate challenge scope, then RFC 9728 protected resource metadata scopes_supported, then the operator’s --scopes, then no scope at all. offline_access is appended whenever the authorization server or protected resource metadata advertises it, or the authorization server advertises the refresh_token grant, so an interactive grant can refresh instead of re-prompting. Finally, OutboundOAuthOptions.ScopeSelector — the SDK’s ScopeSelectorDelegate reused as-is — runs last and may remove offline_access, which this type logs a warning about rather than silently accepting.

Examples

Constructors

.ctor

Initializes a new instance of the ScopeResolver class.

Syntax

Parameters

Exceptions

.ctor Inherited

Inherited from object

Syntax

Methods

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

Resolve

Resolves the scope a token request should ask for, per step 8 of the discovery algorithm.

Syntax

Parameters

Returns

Type: string? The resolved space-delimited scope, or null when nothing resolves to a non-empty scope.

Exceptions

Examples

Remarks

OutboundOAuthOptions.ScopeSelector receives the individual scope tokens as an [IReadOnlyCollection1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlycollection-1) — exactly the SDK 2.2 ScopeSelectorDelegate` signature — and its returned scopes are re-joined with single spaces.

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?