Table of Contents

Class InteractiveAuthenticationProvider

Namespace
PnP.Core.Auth
Assembly
PnP.Core.Auth.dll

Authentication Provider that uses an interactive flow prompting the user for credentials

public class InteractiveAuthenticationProvider : OAuthAuthenticationProvider, IAuthenticationProvider
Inheritance
InteractiveAuthenticationProvider
Implements
Inherited Members

Constructors

InteractiveAuthenticationProvider()

Public constructor for external consumers of the library

public InteractiveAuthenticationProvider()

InteractiveAuthenticationProvider(ILogger<OAuthAuthenticationProvider>, IMsalHttpClientFactory)

Public constructor leveraging DI to initialize the ILogger and IMsalHttpClientFactory interfaces

public InteractiveAuthenticationProvider(ILogger<OAuthAuthenticationProvider> logger, IMsalHttpClientFactory msalHttpClientFactory)

Parameters

logger ILogger<OAuthAuthenticationProvider>

The instance of the logger service provided by DI

msalHttpClientFactory IMsalHttpClientFactory

The instance of the Msal Http Client Factory service provided by DI

InteractiveAuthenticationProvider(string, string, PnPCoreAuthenticationInteractiveOptions)

Public constructor for external consumers of the library

public InteractiveAuthenticationProvider(string clientId, string tenantId, PnPCoreAuthenticationInteractiveOptions options)

Parameters

clientId string

The Client ID for the Authentication Provider

tenantId string

The Tenant ID for the Authentication Provider

options PnPCoreAuthenticationInteractiveOptions

Options for the authentication provider

InteractiveAuthenticationProvider(string, string, Uri)

Public constructor for external consumers of the library

public InteractiveAuthenticationProvider(string clientId, string tenantId, Uri redirectUri)

Parameters

clientId string

The Client ID for the Authentication Provider

tenantId string

The Tenant ID for the Authentication Provider

redirectUri Uri

The Redirect URI for the authentication flow

Properties

RedirectUri

The Redirect URI for the authentication flow

public Uri RedirectUri { get; set; }

Property Value

Uri

Methods

AuthenticateRequestAsync(Uri, HttpRequestMessage)

Authenticates the specified request message.

public override Task AuthenticateRequestAsync(Uri resource, HttpRequestMessage request)

Parameters

resource Uri

Request uri

request HttpRequestMessage

The 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

resource Uri

Resource to request an access token for

Returns

Task<string>

An access token

GetAccessTokenAsync(Uri, string[])

Gets an access token for the requested resource and scope

public override Task<string> GetAccessTokenAsync(Uri resource, string[] scopes)

Parameters

resource Uri

Resource to request an access token for (unused)

scopes string[]

Scopes to request

Returns

Task<string>

An access token