An object to interact with the Laserfiche Cloud OAuth 2.0 token endpoint.

interface ITokenClient {
    getAccessTokenFromCode(code: string, redirect_uri: string, client_id: string, client_secret?: string, code_verifier?: string, scope?: string): Promise<LfApiClientCore.GetAccessTokenResponse>;
    getAccessTokenFromServicePrincipal(servicePrincipalKey: string, accessKey: LfApiClientCore.AccessKey, scope?: string): Promise<LfApiClientCore.GetAccessTokenResponse>;
    refreshAccessToken(refresh_token: string, client_id: string, client_secret?: string): Promise<LfApiClientCore.GetAccessTokenResponse>;
}

Implemented by

Methods

  • Gets an OAuth access token given an OAuth code

    Parameters

    • code: string

      Authorization code

    • redirect_uri: string

      Authorization endpoint redirect uri

    • client_id: string

      OAuth application client id

    • Optionalclient_secret: string

      OPTIONAL OAuth application client secret. Required for web apps.

    • Optionalcode_verifier: string

      OPTIONAL PKCE code verifier. Required for SPA apps.

    • Optionalscope: string

      OPTIONAL The requested space-delimited scopes for the access token.

    Returns Promise<LfApiClientCore.GetAccessTokenResponse>

  • Gets an OAuth access token given a Laserfiche cloud service principal key and an OAuth service application access key.

    Parameters

    • servicePrincipalKey: string

      Laserfiche cloud service principal key

    • accessKey: LfApiClientCore.AccessKey

      OAuth service application access key

    • Optionalscope: string

      OPTIONAL The requested space-delimited scopes for the access token.

    Returns Promise<LfApiClientCore.GetAccessTokenResponse>

  • Gets a refreshed access token given a refresh token

    Parameters

    • refresh_token: string

      Refresh token

    • client_id: string

      OAuth application client id

    • Optionalclient_secret: string

      OPTIONAL OAuth application client secret. Required for web apps.

    Returns Promise<LfApiClientCore.GetAccessTokenResponse>