Documentation
    Preparing search index...

    Class AbstractOAuthAdapterAbstract

    Abstract class summarizing typical OAuth2 Web Application Flows. Extend this to implement providers like GitHub, GitLab, Google, etc.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _alias: string = ''
    _authorizationEndpoint: string
    _params: AuthParameters = {}
    _tokenEndpoint: string
    _userProfileEndpoint: string
    UserClass: typeof User = User

    The User class reference to be used by the adapter.

    Accessors

    • get alias(): string

      Returns string

    • set alias(alias: string): void

      Parameters

      • alias: string

      Returns void

    Methods

    • Deletes a user account from the auth store.

      Parameters

      • user: User

        Target user entity.

      Returns Promise<any>

      Promise resolving to true.

    • Exchanges the temporary authorization code for an access token packet.

      Parameters

      • code: string

        The temporary auth code.

      • OptionalredirectUri: string

        Optional redirect URL context.

      Returns Promise<any>

      Access token payload.

    • Returns the authorization redirect URL.

      Parameters

      • OptionalredirectUri: string

        The callback URL.

      • scopes: string[] = []

        The requested authorization scopes.

      • Optionalstate: string

        The state parameters for CSRF protection.

      Returns string

      The generated authorization URL.

    • Retrieves and validates an auth token payload for the given raw token string.

      Parameters

      • token: string

        Raw authorization token string.

      Returns any

      The resolved token payload or user claims.

    • Returns the pluggable endpoint handler function for this adapter, if any.

      Returns any

      The EndpointHandler callback or null.

    • Initiates password recovery/reset process for a user.

      Parameters

      • email: string

        The user email.

      • OptionalredirectTo: string

        Optional redirect destination.

      Returns Promise<any>

    • Refreshes an expired access token using a refresh token string.

      Parameters

      • refreshToken: string

        Target refresh token.

      Returns Promise<any>

      Throws an error if refresh token logic is not implemented by the provider.

    • Registers a new user account (unsupported for OAuth adapters).

      Parameters

      • user: User

        Target user entity.

      • OptionalclearPassword: string

        Optional cleartext password.

      Returns Promise<any>

      Throws an error indicating registration is unsupported.

    • Revokes the access token (noop default).

      Parameters

      • token: string

        Target token to revoke.

      Returns Promise<any>

    • Inject custom claims (not supported by default).

      Parameters

      • id: string

        Target user ID.

      • claims: any

        Payload claims.

      Returns Promise<any>

    • Signs out the specified user session.

      Parameters

      • user: User

        Target user entity.

      Returns Promise<any>

      Promise resolving to true.

    • Performs user signup with credentials (unsupported for OAuth adapters).

      Parameters

      • login: string

        Login identifier string.

      • password: string

        Password string.

      Returns Promise<any>

      Throws an error indicating signup should use exchangeCodeForToken.

    • Updates user profile attributes in the auth store.

      Parameters

      • user: User

        Target user entity.

      • updatable: any

        Attributes payload to update.

      Returns Promise<any>

      Promise resolving to true.