Class ExternalAuthenticationProvider
Authentication Provider that relies on an external token provider
public sealed class ExternalAuthenticationProvider : OAuthAuthenticationProvider, IAuthenticationProvider
- Inheritance
-
ExternalAuthenticationProvider
- Implements
- Inherited Members
Constructors
ExternalAuthenticationProvider(ILogger<OAuthAuthenticationProvider>)
Public constructor leveraging DI to initialize the ILogger interfafce
public ExternalAuthenticationProvider(ILogger<OAuthAuthenticationProvider> logger)
Parameters
loggerILogger<OAuthAuthenticationProvider>The instance of the logger service provided by DI
ExternalAuthenticationProvider(Func<Uri, string[], string>)
Public constructor for external consumers of the library
public ExternalAuthenticationProvider(Func<Uri, string[], string> accessTokenProvider)
Parameters
ExternalAuthenticationProvider(Func<Uri, string[], Task<string>>)
Public constructor for external consumers of the library
public ExternalAuthenticationProvider(Func<Uri, string[], Task<string>> accessTokenProvider)
Parameters
Properties
AccessTokenProvider
A function providing the access token to use
public Func<Uri, string[], string> AccessTokenProvider { get; set; }
Property Value
AccessTokenTaskProvider
A function providing the access token to use
public Func<Uri, string[], Task<string>> AccessTokenTaskProvider { get; set; }
Property Value
Methods
AuthenticateRequestAsync(Uri, HttpRequestMessage)
Authenticates the specified request message.
public override Task AuthenticateRequestAsync(Uri resource, HttpRequestMessage request)
Parameters
resourceUriRequest uri
requestHttpRequestMessageThe HttpRequestMessage to authenticate.
Returns
- Task
The task to await.
GetAccessTokenAsync(Uri)
Gets an access token for the requested resource
public override Task<string> GetAccessTokenAsync(Uri resource)
Parameters
resourceUriResource to request an access token for
Returns
GetAccessTokenAsync(Uri, string[])
Gets an access token for the requested resource and scope
public override Task<string> GetAccessTokenAsync(Uri resource, string[] scopes)