Class OAuthHandler
HTTP message delegating handler that transparently performs OAuth 2.0 authentication with a client secret. Performs OpenID Connect discovery to find the token endpoint.
public class OAuthHandler : DelegatingHandler, IDisposable
- Inheritance
-
OAuthHandler
- Implements
- Inherited Members
Constructors
OAuthHandler(OAuthOptions, HttpMessageHandler?)
Creates a new OAuth handler.
public OAuthHandler(OAuthOptions oAuthOptions, HttpMessageHandler? innerHandler = null)
Parameters
oAuthOptionsOAuthOptionsOptions for OAuth 2.0 / OpenID Connect authentication.
innerHandlerHttpMessageHandlerAn optional inner HTTP message handler to delegate to.
Methods
SendAsync(HttpRequestMessage, CancellationToken)
Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
requestHttpRequestMessageThe HTTP request message to send to the server.
cancellationTokenCancellationTokenA cancellation token to cancel operation.
Returns
- Task<HttpResponseMessage>
The task object representing the asynchronous operation.
Exceptions
- ArgumentNullException
The
requestwas null.