Class CredentialManagerAuthenticationProvider
Authentication Provider that uses a set of credentials stored in the Credentials Manager of Windows
Inherited Members
Namespace: PnP.Core.Auth
Assembly: PnP.Core.Auth.dll
Syntax
public sealed class CredentialManagerAuthenticationProvider : OAuthAuthenticationProvider, IAuthenticationProvider
Constructors
CredentialManagerAuthenticationProvider(ILogger<OAuthAuthenticationProvider>, IMsalHttpClientFactory)
Public constructor leveraging DI to initialize the ILogger and IMsalHttpClientFactory interfaces
Declaration
public CredentialManagerAuthenticationProvider(ILogger<OAuthAuthenticationProvider> logger, IMsalHttpClientFactory msalHttpClientFactory)
Parameters
|
ILogger<OAuthAuthenticationProvider>
logger
The instance of the logger service provided by DI |
|
IMsalHttpClientFactory
msalHttpClientFactory
The instance of the Msal Http Client Factory service provided by DI |
CredentialManagerAuthenticationProvider(string, string, PnPCoreAuthenticationCredentialManagerOptions)
Public constructor for external consumers of the library
Declaration
public CredentialManagerAuthenticationProvider(string clientId, string tenantId, PnPCoreAuthenticationCredentialManagerOptions options)
Parameters
|
string
clientId
The Client ID for the Authentication Provider |
|
string
tenantId
The Tenant ID for the Authentication Provider |
|
PnPCoreAuthenticationCredentialManagerOptions
options
Options for the authentication provider |
CredentialManagerAuthenticationProvider(string, string, string)
Public constructor for external consumers of the library
Declaration
public CredentialManagerAuthenticationProvider(string clientId, string tenantId, string credentialManagerName)
Parameters
|
string
clientId
The Client ID for the Authentication Provider |
|
string
tenantId
The Tenant ID for the Authentication Provider |
|
string
credentialManagerName
The Name of the Credential Manager item for authentication |
Properties
CredentialManagerName
The name of the Windows Credential Manager settings to use
Declaration
public string CredentialManagerName { get; set; }
Property Value
| 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 |
Overrides
GetAccessTokenAsync(Uri, string[])
Gets an access token for the requested resource and scope. Provide either scopes or resource parameter.
Declaration
public override Task<string> GetAccessTokenAsync(Uri resource, string[] scopes)
Parameters
|
Uri
resource
Resource to request an access token for, only used if scopes is null |
|
string[]
scopes
Scopes to request, can be null |
Returns
|
Task<string>
An access token |