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 FetchRawUserInfo, but normalizes and marshalizes the user api response into a standardized AuthUser struct.

    Parameters

    Returns AuthUser

  • FetchRawUserInfo 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

  • SetExtra updates the provider's custom config data.

    Parameters

    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

  • SetUserInfoURL sets the provider's UserInfoURL.

    Parameters

    • url: string

    Returns void

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

    Returns string

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

    Returns string

Generated using TypeDoc