FutureverseAuthClient

To start using Auth React in your application, first import FutureverseAuthClient and configure it with the required parameters: clientId, environment, and redirectUri. These settings establish your authentication client (authClient) and determine how users interact with authentication. A custom IDP URL can be set to overwrite the default pass online environments.

Here’s an example:

import { FutureverseAuthClient } from '@futureverse/auth-react/auth';

const authClient = new FutureverseAuthClient({
  clientId,
  environment: 'staging',
  redirectUri: 'http://localhost:3000/fp',
  signInFlow: 'redirect',
  /** Custom IDP url goes under authority */
  authority: 'https://jen.passonline.cloud'
});

Use the same client ID and redirect URI for the environment you configured your client in. clientId and redirectUri are required parameters.

Required parameters:

  • clientId: Unique ID obtained by registering your client.

  • environment: The deployment environment (e.g., 'development', 'staging', 'production').

  • redirectUri: The URL where users are redirected post-authentication. Enter the redirect URL used when registering your client.

Optional parameters:

  • responseType: Choose between code or id_token string.

  • userStore: Define a user storage option.

  • clientSecret: Client-specific secret key.

  • signInFlow: redirect or popup string. Set to popup when using the Auth UI modal (redirect is the default).

Developers who opt to use the Auth UI plug-and-play modal, supplied by AuthUiProvider, must include a signInFlow parameter with 'popup'as its value.

Last updated

© 2023 -> ♾️