ordercloud-javascript-sdk
    Preparing search index...

    Class Auth

    Index
    • Parameters

      • clientID: string

        of the application the user is logging into

      • Optionalscope: ApiRole[]

        roles being requested - space delimited string or array

      • OptionalcustomRoles: string[]

        optional custom roles being requested - string array

      • requestOptions: { anonuserid?: string; requestType?: string; signal?: AbortSignal } = {}
        • Optionalanonuserid?: string

          Provide an externally generated id to track this user session, used specifically for the tracking events feature for integrating with Send and Discover

        • OptionalrequestType?: string

          Provide a value that can be used to identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          Provide an AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredObjectDeep<AccessToken>>

      allow users to browse your catalog without signing in - must have anonymous template user set in dashboard

    • Parameters

      • clientSecret: string

        of the application

      • clientID: string

        of the application the user is logging into

      • Optionalscope: ApiRole[]

        roles being requested - space delimited string or array

      • OptionalcustomRoles: string[]

        optional custom roles being requested - string array

      • requestOptions: { requestType?: string; signal?: AbortSignal } = {}
        • OptionalrequestType?: string

          Provide a value that can be used to identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          Provide an AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredObjectDeep<AccessToken>>

      this workflow is best suited for a backend system

    • Parameters

      • clientSecret: string

        of the application

      • username: string

        of the user logging in

      • password: string

        of the user logging in

      • clientID: string

        of the application the user is logging into

      • Optionalscope: ApiRole[]

        roles being requested - space delimited string or array

      • OptionalcustomRoles: string[]

        optional custom roles being requested - string array

      • requestOptions: { requestType?: string; signal?: AbortSignal } = {}
        • OptionalrequestType?: string

          Provide a value that can be used to identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          Provide an AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredObjectDeep<AccessToken>>

      similar to login except client secret is also required, adding another level of security

    • Parameters

      • username: string

        of the user logging in

      • password: string

        of the user logging in

      • clientID: string
      • Optionalscope: ApiRole[]

        optional roles being requested, if omitted will return all assigned roles

      • OptionalcustomRoles: string[]

        optional custom roles being requested - string array

      • requestOptions: { requestType?: string; signal?: AbortSignal } = {}
        • OptionalrequestType?: string

          Provide a value that can be used to identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          Provide an AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredObjectDeep<AccessToken>>

      this workflow is most appropriate for client apps where user is a human, ie a registered user

    • Parameters

      • refreshToken: string

        of the application

      • clientID: string

        of the application the user is logging into

      • requestOptions: { requestType?: string; signal?: AbortSignal } = {}
        • OptionalrequestType?: string

          Provide a value that can be used to identify the type of request. Useful for error logs.

        • Optionalsignal?: AbortSignal

          Provide an AbortSignal that can be used to cancel the request.

      Returns Promise<RequiredObjectDeep<AccessToken>>

      extend your users' session by getting a new access token with a refresh token. refresh tokens must be enabled in the dashboard