Definition
Assembly: Microsoft.OData.Mcp.Authentication.dll Namespace: Microsoft.OData.Mcp.Authentication.Outbound Inheritance: System.ObjectSyntax
Summary
Runs the RFC 6749 authorization code grant with RFC 7636 PKCE over an RFC 8252 loopback redirect: build the authorization URL with anS256 challenge and a bound state, then exchange the returned
code — after the RFC 9207 iss check — for a token.
Remarks
Perspecs/v3/AUTHENTICATION.md “Grants → Authorization code + PKCE + loopback”: S256 is
required and a server that publishes code_challenge_methods_supported without it is refused
rather than downgraded to plain; the SDK’s obsolete AuthorizationRedirectDelegate is never
used; and an iss that disagrees with the selected issuer stops the grant <em>before</em> the code
reaches any token endpoint, which is the RFC 9207 mix-up defense. Per AUTH-12 the code verifier,
the code, and the state never reach a log: the Debug lines carry only the endpoints.
Examples
Constructors
.ctor
Initializes a new instance of the AuthorizationCodePkceGrant class.Syntax
Parameters
Exceptions
.ctor Inherited
Inherited from
objectSyntax
Methods
Begin
Builds the authorization URL the operator signs in at, together with thestate and code
verifier the response is validated and exchanged against.
Syntax
Parameters
Returns
Type:(System.Uri, string, string)
The absolute authorization URI, the freshly generated state, and the code verifier.
Exceptions
Examples
Remarks
The returned code verifier is a secret: it is the only thing that proves the process redeeming the code is the one that requested it, so it must never be logged, elicited, or placed on OutboundConsentRequest. Existing query parameters on the authorization endpoint — a tenant hint, for instance — are preserved rather than replaced.Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
ExchangeAsync
Exchanges an authorization code for a token, after proving the response came from the authorization server this grant was started against.Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<Microsoft.OData.Mcp.Authentication.Outbound.TokenEndpointResponse>
The successful token response.
Exceptions
Remarks
Theiss check runs before anything is sent, so a code minted by another authorization server
is never presented to this one — the whole point of RFC 9207. An absent iss is not invented:
the grant still relies on the state binding the loopback callback enforced.
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?