Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Popup

Hierarchy

  • Popup

Index

Constructors

constructor

  • new Popup(client: any, options: any): Popup
  • Parameters

    • client: any
    • options: any

    Returns Popup

Methods

authorize

  • authorize(options: { audience?: string; clientId?: string; connection?: string; domain: string; nonce?: string; owp?: boolean; redirectUri: string; responseMode?: "query" | "fragment" | "form_post"; responseType: string; scope?: string; state?: string }, callback: Auth0Callback<Auth0Result, Auth0Error>): void
  • Shows inside a new window the hosted login page (/authorize) in order to start a new authN/authZ transaction and post its result using postMessage.

    see

    https://auth0.com/docs/api/authentication#authorize-client

    Parameters

    • options: { audience?: string; clientId?: string; connection?: string; domain: string; nonce?: string; owp?: boolean; redirectUri: string; responseMode?: "query" | "fragment" | "form_post"; responseType: string; scope?: string; state?: string }
      • Optional audience?: string

        identifier of the resource server who will consume the access token issued after Auth

      • Optional clientId?: string

        your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard

      • Optional connection?: string

        identity provider whose login page will be displayed in the popup. If omitted the hosted login page is used. https://auth0.com/docs/identityproviders

      • domain: string

        your Auth0 domain

      • Optional nonce?: string

        value used to mitigate replay attacks when using Implicit Grant. https://auth0.com/docs/api-auth/tutorials/nonce

      • Optional owp?: boolean

        determines if Auth0 should render the relay page or not and the caller is responsible of handling the response.

      • redirectUri: string

        url that the Auth0 will redirect after Auth with the Authorization Response

      • Optional responseMode?: "query" | "fragment" | "form_post"

        how the Auth response is encoded and redirected back to the client. https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes

      • responseType: string

        type of the response used by OAuth 2.0 flow. It can be any space separated list of the values code, token, id_token. https://openid.net/specs/oauth-v2-multiple-response-types-1_0

      • Optional scope?: string

        scopes to be requested during Auth. e.g. openid email

      • Optional state?: string

        value used to mitigate XSRF attacks. https://auth0.com/docs/protocols/oauth2/oauth-state

    • callback: Auth0Callback<Auth0Result, Auth0Error>

    Returns void

Private buildPopupHandler

  • buildPopupHandler(): any
  • Returns a new instance of the popup handler

    Returns any

callback

  • callback(options: { _idTokenVerification?: string; hash: string; nonce?: string; state?: string }): void
  • Handles the popup logic for the callback page.

    see

    parseHash

    Parameters

    • options: { _idTokenVerification?: string; hash: string; nonce?: string; state?: string }
      • Optional _idTokenVerification?: string

        makes parseHash perform or skip id_token verification. We strongly recommend validating the id_token yourself if you disable the verification.

      • hash: string

        the url hash.

        default

        window.location.hash

      • Optional nonce?: string

        value originally sent in nonce parameter to authorize to prevent replay attacks

      • Optional state?: string

        value originally sent in state parameter to authorize to mitigate XSRF

    Returns void

loginWithCredentials

  • loginWithCredentials(options: { redirectUri?: string; responseMode?: "query" | "fragment"; responseType?: "code" | "token"; scope?: string }, callback: Auth0Callback<any, Auth0Error>): void
  • Performs authentication with username/email and password with a database connection inside a new window

    This method is not compatible with API Auth so if you need to fetch API tokens with audience you should use authorize or login.

    Parameters

    • options: { redirectUri?: string; responseMode?: "query" | "fragment"; responseType?: "code" | "token"; scope?: string }
      • Optional redirectUri?: string

        url that the Auth0 will redirect after Auth with the Authorization Response

      • Optional responseMode?: "query" | "fragment"

        how the AuthN response is encoded and redirected back to the client.

      • Optional responseType?: "code" | "token"

        type of the response used.

      • Optional scope?: string

        scopes to be requested during AuthN. e.g. openid email

    • callback: Auth0Callback<any, Auth0Error>

    Returns void

passwordlessVerify

  • passwordlessVerify(options: { connection: string; email?: string; phoneNumber?: string; type: "sms" | "email"; verificationCode: string }, callback: Auth0Callback<any, Auth0Error>): void
  • Verifies the passwordless TOTP and returns the requested token

    Parameters

    • options: { connection: string; email?: string; phoneNumber?: string; type: "sms" | "email"; verificationCode: string }
      • connection: string

        the connection name

      • Optional email?: string

        only if type = email

      • Optional phoneNumber?: string

        only if type = sms

      • type: "sms" | "email"
      • verificationCode: string

        the TOTP code

    • callback: Auth0Callback<any, Auth0Error>

    Returns void

preload

  • preload(options: any): any
  • Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser.

    Parameters

    • options: any

    Returns any

signupAndLogin

  • signupAndLogin(options: { connection: string; email: string; password: string; userMetadata?: unknown }, callback: Auth0Callback<any, Auth0Error>): void
  • Signs up a new user and automatically logs the user in after the signup.

    This method is not compatible with API Auth so if you need to fetch API tokens with audience you should use authorize or signupAndAuthorize.

    Parameters

    • options: { connection: string; email: string; password: string; userMetadata?: unknown }
      • connection: string

        name of the connection where the user will be created

      • email: string

        user email address

      • password: string

        user password

      • Optional userMetadata?: unknown

        allow userMetadata to be passed to signUp

    • callback: Auth0Callback<any, Auth0Error>

    Returns void

Generated using TypeDoc