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
System.String
clientId
The Client ID for the Authentication Provider |
System.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
System.String
clientId
The Client ID for the Authentication Provider |
System.String
tenantId
The Tenant ID for the Authentication Provider |
System.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
System.String
|
Methods
AuthenticateRequestAsync(Uri, HttpRequestMessage)
Authenticates the specified request message.
Declaration
public override async Task AuthenticateRequestAsync(Uri resource, HttpRequestMessage request)
Parameters
Uri
resource
Request uri |
HttpRequestMessage
request
The |
Returns
Task
The task to await. |
Overrides
GetAccessTokenAsync(Uri)
Gets an access token for the requested resource
Declaration
public override async Task<string> GetAccessTokenAsync(Uri resource)
Parameters
Uri
resource
Resource to request an access token for |
Returns
Task<System.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 async Task<string> GetAccessTokenAsync(Uri resource, string[] scopes)
Parameters
Uri
resource
Resource to request an access token for, only used if scopes is null |
System.String[]
scopes
Scopes to request, can be null |
Returns
Task<System.String>
An access token |