Class OAuthAuthenticationProvider
Base authentication provider class
Inheritance
System.Object
OAuthAuthenticationProvider
Namespace: PnP.Core.Auth
Assembly: PnP.Core.Auth.dll
Syntax
public abstract class OAuthAuthenticationProvider : object, IAuthenticationProvider
Constructors
OAuthAuthenticationProvider(ILogger<OAuthAuthenticationProvider>)
Public constructor for any OAuth Authentication privider
Declaration
public OAuthAuthenticationProvider(ILogger<OAuthAuthenticationProvider> logger)
Parameters
ILogger<OAuthAuthenticationProvider>
logger
|
Properties
ClientId
The ClientId of the application to use for authentication
Declaration
public string ClientId { get; set; }
Property Value
System.String
|
ConfigurationName
The Name of the configuration for the Authentication Provider
Declaration
public string ConfigurationName { get; set; }
Property Value
System.String
|
TenantId
The Tenant ID for the application, default value is "organizations" for multi-tenant applications
Declaration
public string TenantId { get; set; }
Property Value
System.String
|
Methods
AuthenticateRequestAsync(Uri, HttpRequestMessage)
Authenticates the specified request message.
Declaration
public abstract Task AuthenticateRequestAsync(Uri resource, HttpRequestMessage request)
Parameters
Uri
resource
Request uri |
HttpRequestMessage
request
The |
Returns
Task
The task to await. |
GetAccessTokenAsync(Uri)
Gets an access token for the requested resource
Declaration
public abstract Task<string> GetAccessTokenAsync(Uri resource)
Parameters
Uri
resource
Resource to request an access token for |
Returns
Task<System.String>
An access token |
GetAccessTokenAsync(Uri, String[])
Gets an access token for the requested resource and scope
Declaration
public abstract Task<string> GetAccessTokenAsync(Uri resource, string[] scopes)
Parameters
Uri
resource
Resource to request an access token for |
System.String[]
scopes
Scopes to request |
Returns
Task<System.String>
An access token |