Class CredentialManagerAuthenticationProvider
Authentication Provider that uses a set of credentials stored in the Credentials Manager of Windows
public sealed class CredentialManagerAuthenticationProvider : OAuthAuthenticationProvider, IAuthenticationProvider
- Inheritance
-
CredentialManagerAuthenticationProvider
- Implements
- Inherited Members
Constructors
CredentialManagerAuthenticationProvider(ILogger<OAuthAuthenticationProvider>, IMsalHttpClientFactory)
Public constructor leveraging DI to initialize the ILogger and IMsalHttpClientFactory interfaces
public CredentialManagerAuthenticationProvider(ILogger<OAuthAuthenticationProvider> logger, IMsalHttpClientFactory msalHttpClientFactory)
Parameters
loggerILogger<OAuthAuthenticationProvider>The instance of the logger service provided by DI
msalHttpClientFactoryIMsalHttpClientFactoryThe instance of the Msal Http Client Factory service provided by DI
CredentialManagerAuthenticationProvider(string, string, PnPCoreAuthenticationCredentialManagerOptions)
Public constructor for external consumers of the library
public CredentialManagerAuthenticationProvider(string clientId, string tenantId, PnPCoreAuthenticationCredentialManagerOptions options)
Parameters
clientIdstringThe Client ID for the Authentication Provider
tenantIdstringThe Tenant ID for the Authentication Provider
optionsPnPCoreAuthenticationCredentialManagerOptionsOptions for the authentication provider
CredentialManagerAuthenticationProvider(string, string, string)
Public constructor for external consumers of the library
public CredentialManagerAuthenticationProvider(string clientId, string tenantId, string credentialManagerName)
Parameters
clientIdstringThe Client ID for the Authentication Provider
tenantIdstringThe Tenant ID for the Authentication Provider
credentialManagerNamestringThe Name of the Credential Manager item for authentication
Properties
CredentialManagerName
The name of the Windows Credential Manager settings to use
public string CredentialManagerName { get; set; }
Property Value
Methods
AuthenticateRequestAsync(Uri, HttpRequestMessage)
Authenticates the specified request message.
public override 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 override 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. Provide either scopes or resource parameter.
public override Task<string> GetAccessTokenAsync(Uri resource, string[] scopes)
Parameters
resourceUriResource to request an access token for, only used if scopes is null
scopesstring[]Scopes to request, can be null