Definition
Assembly: Microsoft.OData.Mcp.Authentication.dll Namespace: Microsoft.OData.Mcp.Authentication.Outbound Inheritance: System.ObjectSyntax
Summary
Posts an RFC 6749 token request on the handler-free"OAuth" named HttpClient and
turns the answer into either a TokenEndpointResponse or an
OAuthTokenException. Every grant in this package — device code, refresh, authorization
code, client credentials — sends its token request through this one class.
Remarks
A new"OAuth" client is requested from IHttpClientFactory on every call rather than
cached, matching the “Two named HttpClients” table in specs/v3/AUTHENTICATION.md. Per
AUTH-12 neither the request form, the response body, nor any credential is ever logged: the Debug
entries carry only the endpoint, the grant_type, the token type, the lifetime, and whether a
refresh token came back. Unlike well-known discovery, a token request is never retried here — a token
POST is not idempotent and a failed grant is a decision for the caller, not a transport retry.
Examples
Constructors
.ctor
Initializes a new instance of the TokenEndpointClient class.Syntax
Parameters
Exceptions
.ctor Inherited
Inherited from
objectSyntax
Methods
Equals Inherited Virtual
Inherited from
objectSyntax
Parameters
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
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
PostAsync
Posts a token request and returns the RFC 6749 section 5.1 success response.Syntax
Parameters
Returns
Type:System.Threading.Tasks.Task<Microsoft.OData.Mcp.Authentication.Outbound.TokenEndpointResponse>
The parsed success response, whose TokenEndpointResponse.AccessToken is guaranteed
non-empty.
Exceptions
Remarks
The RFC 8707resource indicator and scope are the caller’s to place in
form; this method never invents either, so a grant that must omit resource
simply leaves it out. Cancellation requested through cancellationToken propagates
as OperationCanceledException rather than being wrapped.
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?