Definition
Assembly: Microsoft.OData.Mcp.Authentication.dll Namespace: Microsoft.OData.Mcp.Authentication.Outbound Inheritance: System.ObjectSyntax
Summary
Selects the OutboundGrantKind outbound OAuth runs for a remote OData service, per step 6 of the discovery algorithm: an operator override when advertised and implemented, else enterprise identity assertion, else non-interactive client credentials, else the interactive default of device code falling back to authorization code.Remarks
This type never runs a grant itself; it only decides which one a caller should run. PerAUTH-5 it
is a top-level type, and per specs/v3/AUTHENTICATION.md it throws
NotSupportedException — never silently substituting another grant — for a kind this build
has not registered a grant class for yet, so a PR that lands a new grant only has to add it to
GrantSelector.Implemented.
Examples
Methods
IsImplemented
Determines whether a grant kind is registered in this build.Syntax
Parameters
Returns
Type:bool
true when kind is in GrantSelector.Implemented.
Select
Selects the grant kind to run for a discovered authorization server, per step 6 of the discovery algorithm.Syntax
Parameters
Returns
Type:Microsoft.OData.Mcp.Authentication.Outbound.OutboundGrantKind
The selected grant kind.
Exceptions
Examples
Remarks
Selection order is: (1) an explicit OutboundOAuthOptions.Grant override; (2) enterprise identity assertion when an IdP endpoint and an id token source are both configured, which fails first rather than silently falling through when the authorization server does not advertise the RFC 7523 JWT bearer grant type; (3) non-interactive client credentials when advertised and a client secret is configured; (4) the interactive default of device code, falling back to authorization code, when interactive istrue.