Class GitHubStrategy<User>

Type Parameters

  • User

Hierarchy

Constructors

Properties

client: GitHub
name: string = "github"

The name of the strategy. This will be used by the Authenticator to identify and retrieve the strategy.

verify: VerifyFunction<User, VerifyOptions>

Methods

  • The authentication flow of the strategy.

    This method receives the Request from the authenticator we want to authenticate.

    At the end of the flow, it will return a the User data to be used by the application.

    Parameters

    Returns Promise<User>

  • Return extra parameters to be included in the authorization request.

    Some OAuth 2.0 providers allow additional, non-standard parameters to be included when requesting authorization. Since these parameters are not standardized by the OAuth 2.0 specification, OAuth 2.0-based authentication strategies can override this function in order to populate these parameters as required by the provider.

    Parameters

    Returns URLSearchParams

  • Get a new OAuth2 Tokens object using the refresh token once the previous access token has expired.

    Parameters

    • refreshToken: string

      The refresh token to use to get a new access token

    Returns Promise<OAuth2Tokens>

    The new OAuth2 tokens object

    let tokens = await strategy.refreshToken(refreshToken);
    console.log(tokens.accessToken());