Function auth

  • OAuth2-based authorization layer

    Parameters

    • options: AuthOptions

      Represents a set of options required for authenticating a client

    Returns {
        getAccessToken: ((authCode) => Promise<AccessToken>);
        refreshAccessToken: ((refreshToken) => Promise<AccessToken>);
    }

    • getAccessToken: ((authCode) => Promise<AccessToken>)
        • (authCode): Promise<AccessToken>
        • Retrieves an access token from an OAuth2 authentication request using the provided authorization code

          Parameters

          • authCode: string

            A string representing the authorization code received from the OAuth2 authentication request

          Returns Promise<AccessToken>

          A Promise that resolves with an AccessToken object representing the retrieved access token

    • refreshAccessToken: ((refreshToken) => Promise<AccessToken>)
        • (refreshToken): Promise<AccessToken>
        • Retrieves a new access token from an OAuth2 authentication request using the provided refresh token

          Parameters

          • refreshToken: string

            A string representing the refresh token received from a previous OAuth2 authentication request

          Returns Promise<AccessToken>

          A Promise that resolves with an AccessToken object representing the retrieved access token

Generated using TypeDoc