Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AuthenticationClient

Client providing access to APS Authentication API (https://aps.autodesk.com/en/docs/oauth/v2/reference/http).

tutorial

authentication

Hierarchy

  • AuthenticationClient

Index

Constructors

constructor

  • new AuthenticationClient(client_id: string, client_secret: string, host?: string): AuthenticationClient
  • Initializes new client with specific APS app credentials.

    Parameters

    • client_id: string

      APS application client ID.

    • client_secret: string

      APS application client secret.

    • host: string = 'https://developer.api.autodesk.com'

    Returns AuthenticationClient

Properties

Private _cached

_cached: {}

Type declaration

  • [key: string]: ITokenCache

Private client_id

client_id: string

Private client_secret

client_secret: string

Private host

host: string

Accessors

clientId

  • get clientId(): string

Methods

authenticate

  • authenticate(scopes: string[], force?: boolean): Promise<ITwoLeggedToken>
  • Retrieves 2-legged access token for a specific set of scopes (https://aps.autodesk.com/en/docs/oauth/v2/reference/http/gettoken-POST/). Unless the {@see force} parameter is used, the access tokens are cached based on their scopes and the 'expires_in' field in the response.

    Parameters

    • scopes: string[]

      List of requested scopes.

    • force: boolean = false

    Returns Promise<ITwoLeggedToken>

    Promise of 2-legged authentication object containing two fields, 'access_token' with the actual token, and 'expires_in' with expiration time (in seconds).

getAuthorizeRedirect

  • getAuthorizeRedirect(scopes: string[], redirectUri: string): string

getToken

getUserProfile

Protected post

  • post(endpoint: string, params: any, config?: AxiosRequestConfig): Promise<AxiosResponse<any>>
  • Parameters

    • endpoint: string
    • params: any
    • Optional config: AxiosRequestConfig

    Returns Promise<AxiosResponse<any>>

refreshToken

Generated using TypeDoc