API Docs for: 0.0.8
Show:

RedirectBroker Class

Authenticate a user with the redirect flow.

Constructor

RedirectBroker

()

Methods

bestChoice

(
  • config
)

Best choice auth strategy, has no action set

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.

forceAuth

(
  • config
)

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

openFxa

(
  • fxaUrl
  • }
)
protected

Open Firefox Accounts to authenticate the user. Must be overridden to provide API specific functionality.

Parameters:

  • fxaUrl String
    • URL to open for authentication
  • } Options=

    options

setContext

(
  • context
)

Set the context field to be passed to the content server. If not set, no context will be sent. Should be called by sub-classes if a context is needed.

Parameters:

  • context String

signIn

(
  • config
)

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.

signUp

(
  • config
)

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.