Provider defines a common interface for an OAuth2 client.

Hierarchy

  • Provider

Indexable

[key: string]: any

Methods

  • AuthUrl returns the provider's authorization service url.

    Returns string

  • BuildAuthUrl returns a URL to the provider's consent page that asks for permissions for the required scopes explicitly.

    Parameters

    Returns string

  • Client returns an http client using the provided token.

    Parameters

    Returns any

  • ClientId returns the provider client's app ID.

    Returns string

  • ClientSecret returns the provider client's app secret.

    Returns string

  • DisplayName usually returns provider name as it is officially written and it could be used directly in the UI.

    Returns string

  • FetchAuthUser is similar to FetchRawUserData, but normalizes and marshalizes the user api response into a standardized AuthUser struct.

    Parameters

    Returns AuthUser

  • FetchRawUserData requests and marshalizes into result the the OAuth user api response.

    Parameters

    Returns string | number[]

  • PKCE indicates whether the provider can use the PKCE flow.

    Returns boolean

  • RedirectUrl returns the end address to redirect the user going through the OAuth flow.

    Returns string

  • Scopes returns the provider access permissions that will be requested.

    Returns string[]

  • SetAuthUrl sets the provider's AuthUrl.

    Parameters

    • url: string

    Returns void

  • SetClientId sets the provider client's ID.

    Parameters

    • clientId: string

    Returns void

  • SetClientSecret sets the provider client's app secret.

    Parameters

    • secret: string

    Returns void

  • SetContext assigns the specified context to the current provider.

    Parameters

    Returns void

  • SetDisplayName sets the provider's display name.

    Parameters

    • displayName: string

    Returns void

  • SetPKCE toggles the state whether the provider can use the PKCE flow or not.

    Parameters

    • enable: boolean

    Returns void

  • SetRedirectUrl sets the provider's RedirectUrl.

    Parameters

    • url: string

    Returns void

  • SetScopes sets the provider access permissions that will be requested later.

    Parameters

    • scopes: string[]

    Returns void

  • SetTokenUrl sets the provider's TokenUrl.

    Parameters

    • url: string

    Returns void

  • SetUserApiUrl sets the provider's UserApiUrl.

    Parameters

    • url: string

    Returns void

  • TokenUrl returns the provider's token exchange service url.

    Returns string

  • UserApiUrl returns the provider's user info api url.

    Returns string

Generated using TypeDoc