Class OAuthAuthenticationProvider
Base authentication provider class
public abstract class OAuthAuthenticationProvider : IAuthenticationProvider
- Inheritance
-
OAuthAuthenticationProvider
- Implements
- Derived
- Inherited Members
Constructors
OAuthAuthenticationProvider(ILogger<OAuthAuthenticationProvider>)
Public constructor for any OAuth Authentication privider
public OAuthAuthenticationProvider(ILogger<OAuthAuthenticationProvider> logger)
Parameters
loggerILogger<OAuthAuthenticationProvider>
Properties
ClientId
The ClientId of the application to use for authentication
public string ClientId { get; set; }
Property Value
ConfigurationName
The Name of the configuration for the Authentication Provider
public string ConfigurationName { get; set; }
Property Value
TenantId
The Tenant ID for the application, default value is "organizations" for multi-tenant applications
public string TenantId { get; set; }
Property Value
Methods
AuthenticateRequestAsync(Uri, HttpRequestMessage)
Authenticates the specified request message.
public abstract 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 abstract 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 abstract Task<string> GetAccessTokenAsync(Uri resource, string[] scopes)