Search Results for

    Show / Hide Table of Contents

    Class ExternalAuthenticationProvider

    Authentication Provider that relies on an external token provider

    Inheritance
    System.Object
    OAuthAuthenticationProvider
    ExternalAuthenticationProvider
    Inherited Members
    OAuthAuthenticationProvider.ConfigurationName
    OAuthAuthenticationProvider.ClientId
    OAuthAuthenticationProvider.TenantId
    Namespace: PnP.Core.Auth
    Assembly: PnP.Core.Auth.dll
    Syntax
    public sealed class ExternalAuthenticationProvider : OAuthAuthenticationProvider, IAuthenticationProvider

    Constructors

    ExternalAuthenticationProvider(Func<Uri, String[], String>)

    Public constructor for external consumers of the library

    Declaration
    public ExternalAuthenticationProvider(Func<Uri, string[], string> accessTokenProvider)
    Parameters
    Func<Uri, System.String[], System.String> accessTokenProvider

    A function providing the access token to use

    ExternalAuthenticationProvider(Func<Uri, String[], Task<String>>)

    Public constructor for external consumers of the library

    Declaration
    public ExternalAuthenticationProvider(Func<Uri, string[], Task<string>> accessTokenProvider)
    Parameters
    Func<Uri, System.String[], Task<System.String>> accessTokenProvider

    A function providing the access token to use

    ExternalAuthenticationProvider(ILogger<OAuthAuthenticationProvider>)

    Public constructor leveraging DI to initialize the ILogger interfafce

    Declaration
    public ExternalAuthenticationProvider(ILogger<OAuthAuthenticationProvider> logger)
    Parameters
    ILogger<OAuthAuthenticationProvider> logger

    The instance of the logger service provided by DI

    Properties

    AccessTokenProvider

    A function providing the access token to use

    Declaration
    public Func<Uri, string[], string> AccessTokenProvider { get; set; }
    Property Value
    Func<Uri, System.String[], System.String>

    AccessTokenTaskProvider

    A function providing the access token to use

    Declaration
    public Func<Uri, string[], Task<string>> AccessTokenTaskProvider { get; set; }
    Property Value
    Func<Uri, System.String[], Task<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 to authenticate.

    Returns
    Task

    The task to await.

    Overrides
    OAuthAuthenticationProvider.AuthenticateRequestAsync(Uri, HttpRequestMessage)

    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
    OAuthAuthenticationProvider.GetAccessTokenAsync(Uri)

    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

    System.String[] scopes

    Scopes to request

    Returns
    Task<System.String>

    An access token

    Overrides
    OAuthAuthenticationProvider.GetAccessTokenAsync(Uri, String[])
    Back to top PnP Core SDK
    Generated by DocFX with Material UI
    spacer