Interface RedirectConnectAccountOptions<TAppState>

interface RedirectConnectAccountOptions<TAppState> {
    appState?: TAppState;
    authorization_params?: AuthorizationParams;
    connection: string;
    openUrl?: ((url) => Promise<void>);
    redirectUri?: string;
}

Type Parameters

  • TAppState = any

Properties

appState?: TAppState

Optional application state to persist through the transaction.

Example

await auth0.connectAccountWithRedirect({
connection: 'google-oauth2',
appState: { returnTo: '/settings' }
});
authorization_params?: AuthorizationParams

Additional authorization parameters for the request.

Example

await auth0.connectAccountWithRedirect({
connection: 'google-oauth2',
authorization_params: {
scope: 'https://www.googleapis.com/auth/calendar'
access_type: 'offline'
}
});

Example

await auth0.connectAccountWithRedirect({
connection: 'github',
authorization_params: {
scope: 'repo user',
audience: 'https://api.github.com'
}
});
connection: string

The name of the connection to link (e.g. 'google-oauth2').

openUrl?: ((url) => Promise<void>)

Optional function to handle the redirect URL.

Type declaration

    • (url): Promise<void>
    • Optional function to handle the redirect URL.

      Parameters

      • url: string

      Returns Promise<void>

      Example

      await auth0.connectAccountWithRedirect({
      connection: 'google-oauth2',
      openUrl: async (url) => { myBrowserApi.open(url); }
      });

Example

await auth0.connectAccountWithRedirect({
connection: 'google-oauth2',
openUrl: async (url) => { myBrowserApi.open(url); }
});
redirectUri?: string

The URI to redirect back to after connecting the account.