The URL to return to after a successful login redirect callback.
Application state saved before the user was redirected for a login.
Property | Type | Description |
---|---|---|
|
|
The URL to return to after a successful login redirect callback. |
|
|
extends AuthState
Property | Type | Description |
---|---|---|
|
|
Redirects the browser to the change password page on the authorization server. |
|
|
Redirects the browser to the registration page on the authorization server |
|
|
Attempts check the user’s session by silently retrieving an access token. If the user is no longer authenticated, this will clear the authentication state. |
|
|
The current client ID. |
|
|
Find the user operations for the scopes for the user. This is useful for the client to know what operations the user is permitted to use for different scopes, e.g., can they manage account users? The object this returns will have a list of operations. Each operation will be a security
scope mapped to the permitted operations such as |
|
|
Retrieve an access token for the user using the silent authentication flow. |
|
|
Retrieve the [User] information for the current user. |
|
|
Redirects the user to the authorization server’s login page as part of the Authorization Code Grant with PCKE flow. |
|
|
Logs out the current user with a redirect URI back to the application. |
|
|
Logs in the user with the given credentials rather than redirecting to the Auth Service hosted form. Requires additional configuration on the backend to enable:
|
|
|
Registers the user with the given form data rather than redirecting to the Auth Service hosted form. Requires additional configuration on the backend to enable:
|
|
|
Changes the user’s password with the given one rather than redirecting to the Auth Service hosted form. Requires additional configuration on the backend to enable:
|
|
|
Resets the user’s password with the given one rather than redirecting to the Auth Service hosted form. Requires additional configuration on the backend to enable:
|
|
|
Submits a request to get a reset-password link in an email rather than redirecting to the Auth Service hosted form. Requires additional configuration on the backend to enable:
|
|
|
Updates the account ID if the user has selected to operate in an Account context. This will also cause a new access token to be fetched. |
|
|
Reads the roles available to the account (e.g., business account) users. |
Props for the AuthProvider
.
Property | Type | Description |
---|---|---|
|
|
The account ID selected for the user. |
|
|
The base URL of the authorization server. |
|
|
The children components of this provider. |
|
|
The client ID. |
|
|
Whether to send credentials for cross-site XHR requests. Defaults to
|
|
|
A customer initializer function to create a new |
|
|
|
|
|
Determines whether a param indicating that the app should automatically redirect the user to login is enabled. This is used in cases where auto-login from the server is not possible due to needing third-party-cookies, which are blocked in most browsers by default. This param is usually not used unless refresh-token-rotation is also used. |
|
|
The default redirect URI used for login redirect flow. Defaults to
|
|
|
The default scope used for authorization requests. Defaults to |
|
|
The default redirect URI used for iframe, silent-authentication flow. This is only used if
|
|
|
Whether or not to skip the redirect callback. This may be necessary in certain scenarios where you are mixing authentication providers. |
|
|
Optionally provide a custom [TokenCache] implementation for storing access tokens. The default is WebStorageTokenCache. |
|
|
Optionally provide a custom WebStorage implementation for storing transactions. The default is SessionStorage. |
|
|
Whether to enabled the Proof-Key-for-Code-Exchange enhancement to the OAuth Authorization Code Flow. False by default. |
|
|
Whether to use a refresh token rotation instead of iframe silent auth. The default is <a href="https://developer.broadleafcommerce.com/services/authentication-services/authorization#refresh_token_rotation_grant_type_em_since_1_4_0_em"> See Refresh Token (Rotation) Grant Type docs</a>. |
|
|
Whether to use silent authentication with iframe as a fallback when Note that this still has the same drawbacks as auth code flow with silent auth if the browser has enabled Intelligent Tracking Protection and the user may need to be redirected to login after a refreshing the page. |
|
|
Whether to serialize the in-memory token cache to session storage to allow persistence across page loads. This is somewhat less secure than leaving the cache in-memory but may be necessary
in cross-domain auth contexts, i.e., when the client is served on a different
domain from the auth server, because browsers block the cross-domain session cookie.
In these cases, the additional risk should be mitigated by also enabling
refresh tokens ( |
|
|
See |
|
|
If enabled, then user operations will be fetched using the 'resource API' user operations endpoint that accepts a bearer token. Otherwise, user operations will be fetched using the endpoint that relies on session cookie authentication. The access-token approach is useful when in a cross-domain environment that can’t pass session cookies. |
Contains information about the state of authentication such as whether the user is authenticated, the user’s details, and if there was an error during authentication.
Here’s the flow for some key properties:
Authentication check has not been performed:
{
"isAuthenticated": false,
"didAuthenticationCheck": false,
"isLoading": false
}
Authentication check is in process
{
"isAuthenticated": false,
"didAuthenticationCheck": false,
"isLoading": true
}
Authentication check has occurred and user is authenticated
{
"isAuthenticated": true,
"didAuthenticationCheck": true,
"isLoading": false
}
Authentication check has occurred and user is not authenticated
{
"isAuthenticated": false,
"didAuthenticationCheck": true,
"isLoading": false
}
Property | Type | Description |
---|---|---|
|
|
An error that occurred during authentication. |
|
|
Whether the user is to be authenticated. Will be false if the authentication request has not been received or is pending. |
|
|
Whether authentication has been attempted. Will be false until the check actually takes place and is completed. |
|
|
Whether the authentication check is ongoing. Will be false before authentication has been attempted. |
|
|
The expiry for the user’s session including the inactivity |
|
|
Claims for an issued access token. |