Class X509CertificateAuthenticationProvider
Authentication Provider based on the X.509 Certificate
Inherited Members
Namespace: PnP.Core.Auth
Assembly: PnP.Core.Auth.dll
Syntax
public sealed class X509CertificateAuthenticationProvider : OAuthAuthenticationProvider, IAuthenticationProvider
Constructors
X509CertificateAuthenticationProvider(ILogger<OAuthAuthenticationProvider>, IMsalHttpClientFactory)
Public constructor leveraging DI to initialize the ILogger and IMsalHttpClientFactory interfaces
Declaration
public X509CertificateAuthenticationProvider(ILogger<OAuthAuthenticationProvider> logger, IMsalHttpClientFactory msalHttpClientFactory)
Parameters
ILogger<OAuth The instance of the logger service provided by DI |
IMsal The instance of the Msal Http Client Factory service provided by DI |
X509CertificateAuthenticationProvider(String, String, PnPCoreAuthenticationX509CertificateOptions)
Public constructor for external consumers of the library
Declaration
public X509CertificateAuthenticationProvider(string clientId, string tenantId, PnPCoreAuthenticationX509CertificateOptions options)
Parameters
System. The Client ID for the Authentication Provider |
System. The Tenant ID for the Authentication Provider |
Pn Options for the authentication provider |
X509CertificateAuthenticationProvider(String, String, StoreName, StoreLocation, String)
Public constructor for external consumers of the library
Declaration
public X509CertificateAuthenticationProvider(string clientId, string tenantId, StoreName storeName, StoreLocation storeLocation, string thumbprint)
Parameters
System. The Client ID for the Authentication Provider |
System. The Tenant ID for the Authentication Provider |
Store The Store Name to get the X.509 certificate from |
Store The Store Location to get the X.509 certificate from |
System. The Thumbprint of the X.509 certificate |
X509CertificateAuthenticationProvider(String, String, X509Certificate2)
Public constructor for external consumers of the library
Declaration
public X509CertificateAuthenticationProvider(string clientId, string tenantId, X509Certificate2 certificate)
Parameters
System. The Client ID for the Authentication Provider |
System. The Tenant ID for the Authentication Provider |
X509Certificate2
certificate
The X.509 certificate to use for authentication |
Properties
Certificate
The X.509 Certificate to use for app authentication
Declaration
public X509Certificate2 Certificate { get; set; }
Property Value
X509Certificate2
|
Methods
AuthenticateRequestAsync(Uri, HttpRequestMessage)
Authenticates the specified request message.
Declaration
public override async Task AuthenticateRequestAsync(Uri resource, HttpRequestMessage request)
Parameters
Uri
resource
Request uri |
Http 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. An access token |
Overrides
GetAccessTokenAsync(Uri, String[])
Gets an access token for the requested resource and scope
Declaration
public override async Task<string> GetAccessTokenAsync(Uri resource, string[] scopes)
Parameters
Uri
resource
Resource to request an access token for (unused) |
System. Scopes to request |
Returns
Task<System. An access token |