Class ExternalAuthenticationProvider
Authentication Provider that relies on an external token provider
Inherited Members
Namespace: PnP.Core.Auth
Assembly: PnP.Core.Auth.dll
Syntax
public sealed class ExternalAuthenticationProvider : OAuthAuthenticationProvider, IAuthenticationProvider
Constructors
ExternalAuthenticationProvider(ILogger<OAuthAuthenticationProvider>)
Public constructor leveraging DI to initialize the ILogger interfafce
Declaration
public ExternalAuthenticationProvider(ILogger<OAuthAuthenticationProvider> logger)
Parameters
|
ILogger<OAuthAuthenticationProvider>
logger
The instance of the logger service provided by DI |
ExternalAuthenticationProvider(Func<Uri, string[], string>)
Public constructor for external consumers of the library
Declaration
public ExternalAuthenticationProvider(Func<Uri, string[], string> accessTokenProvider)
Parameters
|
Func<Uri, string[], string>
accessTokenProvider
A function providing the access token to use |
ExternalAuthenticationProvider(Func<Uri, string[], Task<string>>)
Public constructor for external consumers of the library
Declaration
public ExternalAuthenticationProvider(Func<Uri, string[], Task<string>> accessTokenProvider)
Parameters
|
Func<Uri, string[], Task<string>>
accessTokenProvider
A function providing the access token to use |
Properties
AccessTokenProvider
A function providing the access token to use
Declaration
public Func<Uri, string[], string> AccessTokenProvider { get; set; }
Property Value
| Func<Uri, string[], string> |
AccessTokenTaskProvider
A function providing the access token to use
Declaration
public Func<Uri, string[], Task<string>> AccessTokenTaskProvider { get; set; }
Property Value
| Func<Uri, string[], Task<string>> |
Methods
AuthenticateRequestAsync(Uri, HttpRequestMessage)
Authenticates the specified request message.
Declaration
public override Task AuthenticateRequestAsync(Uri resource, HttpRequestMessage request)
Parameters
|
Uri
resource
Request uri |
|
HttpRequestMessage
request
The HttpRequestMessage to authenticate. |
Returns
|
Task
The task to await. |
Overrides
GetAccessTokenAsync(Uri)
Gets an access token for the requested resource
Declaration
public override Task<string> GetAccessTokenAsync(Uri resource)
Parameters
|
Uri
resource
Resource to request an access token for |
Returns
|
Task<string>
An access token |