API Docs for: 0.0.8
Show:

AuthAPI Class

Constructor

AuthAPI

(
  • clientId
  • [options={}]
)

Parameters:

  • clientId String
    • the OAuth client ID for the relier
  • [options={}] Object optional
    • configuration
    • [contentHost] String optional

      Firefox Accounts Content Server host

    • [oauthHost] String optional

      Firefox Accounts OAuth Server host

    • [window] Object optional

      window override, used for unit tests

    • [lightbox] Object optional

      lightbox override, used for unit tests

    • [channel] Object optional

      channel override, used for unit tests

Item Index

Methods

bestChoice

(
  • config
  • [options.zIndex]
  • [options.background]
)

Best choice auth strategy, has no action set. This strategy creates an oauth url to the "/oauth" endpoint on the content server. The oauth url has no action and the content server choose the auth flow.

Parameters:

  • config Object
    • configuration
    • state String

      CSRF/State token

    • redirectUri String

      URI to redirect to when complete

    • scope String

      OAuth scope

    • [email] String optional

      Email address used to pre-fill into the account form, but the user is free to change it.

    • [ui] String optional

      UI to present - lightbox or redirect - defaults to redirect

  • [options.zIndex] Number optional

    only used when config.ui=lightbox. The zIndex of the lightbox background.

  • [options.background] String optional

    only used when config.ui=lightbox. The background CSS value

forceAuth

(
  • config
  • [options.zIndex]
  • [options.background]
)

Force a user to sign in as an existing user.

Parameters:

  • config Object
    • configuration
    • state String

      CSRF/State token

    • redirectUri String

      URI to redirect to when complete

    • scope String

      OAuth scope

    • email String

      Email address the user must sign in with. The user is unable to modify the email address and is unable to sign up if the address is not registered.

    • [ui] String optional

      UI to present - lightbox or redirect - defaults to redirect

  • [options.zIndex] Number optional

    only used when config.ui=lightbox. The zIndex of the lightbox background.

  • [options.background] String optional

    only used when config.ui=lightbox. The background CSS value

signIn

(
  • config
  • [options.zIndex]
  • [options.background]
)

Sign in an existing user.

Parameters:

  • config Object
    • configuration
    • state String

      CSRF/State token

    • redirectUri String

      URI to redirect to when complete

    • scope String

      OAuth scope

    • [email] String optional

      Email address used to pre-fill into the account form, but the user is free to change it. Set to the string literal blank to ignore any previously signed in email. Default is the last email address used to sign in.

    • [ui] String optional

      UI to present - lightbox or redirect - defaults to redirect

  • [options.zIndex] Number optional

    only used when config.ui=lightbox. The zIndex of the lightbox background.

  • [options.background] String optional

    only used when config.ui=lightbox. The background CSS value

signUp

(
  • config
  • [options.zIndex]
  • [options.background]
)

Sign up a new user

Parameters:

  • config Object
    • configuration
    • state String

      CSRF/State token

    • redirectUri String

      URI to redirect to when complete

    • scope String

      OAuth scope

    • [email] String optional

      Email address used to pre-fill into the account form, but the user is free to change it.

    • [ui] String optional

      UI to present - lightbox or redirect - defaults to redirect

  • [options.zIndex] Number optional

    only used when config.ui=lightbox. The zIndex of the lightbox background.

  • [options.background] String optional

    only used when config.ui=lightbox. The background CSS value