Options
All
  • Public
  • Public/Protected
  • All
Menu

Module auth

Functions

getAccessToken

  • getAccessToken(requestClient: RequestClient, clientId: string, clientSecret: string, authCode: string): Promise<SasAuthResponse>
  • Exchanges the auth code for an access token for the given client.

    Parameters

    • requestClient: RequestClient

      the pre-configured HTTP request client

    • clientId: string

      the client ID to authenticate with.

    • clientSecret: string

      the client secret to authenticate with.

    • authCode: string

      the auth code received from the server.

    Returns Promise<SasAuthResponse>

getTokens

  • getTokens(requestClient: RequestClient, authConfig: AuthConfig): Promise<AuthConfig>
  • Returns the auth configuration, refreshing the tokens if necessary.

    Parameters

    • requestClient: RequestClient

      the pre-configured HTTP request client

    • authConfig: AuthConfig

      an object containing a client ID, secret, access token and refresh token

    Returns Promise<AuthConfig>

Const isAuthorizeFormRequired

  • isAuthorizeFormRequired(response: string): boolean

Const isLogInRequired

  • isLogInRequired(response: string): boolean

Const isLoggedInSASVIYA

  • isLoggedInSASVIYA(): boolean

openWebPage

  • openWebPage(url: string, windowName?: string, WindowFeatures?: WindowFeatures, onLoggedOut?: undefined | function): Promise<Window | null>
  • Parameters

    • url: string
    • Default value windowName: string = ""
    • Default value WindowFeatures: WindowFeatures = defaultWindowFeatures
    • Optional onLoggedOut: undefined | function

    Returns Promise<Window | null>

refreshTokens

  • refreshTokens(requestClient: RequestClient, clientId: string, clientSecret: string, refreshToken: string): Promise<SasAuthResponse>
  • Exchanges the refresh token for an access token for the given client.

    Parameters

    • requestClient: RequestClient

      the pre-configured HTTP request client

    • clientId: string

      the client ID to authenticate with.

    • clientSecret: string

      the client secret to authenticate with.

    • refreshToken: string

    Returns Promise<SasAuthResponse>

verifySas9Login

  • verifySas9Login(loginPopup: Window): Promise<object>

verifySasViyaLogin

  • verifySasViyaLogin(loginPopup: Window): Promise<object>

Generated using TypeDoc