The bearer access token string.
extends IdentityClaims
The result of an OAuth2 access token request.
Property | Type | Description |
---|---|---|
|
|
The bearer access token string. |
|
|
The refresh token to use to get a new access token. |
|
|
The time in which the access token expires. |
|
|
The scope this token is authorized for. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Configuration options that can be passed into an AuthClient when instantiated.
Property | Type | Description | ||
---|---|---|---|---|
|
|
The account ID selected for the user. |
||
|
|
The base URL of the authorization server. |
||
|
|
The client ID. |
||
|
|
Whether or not to send credentials for cross-site XHR requests. Defaults to
|
||
|
|
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 silent authentication flow. This is only used if
|
||
|
|
Optionally provide a custom WebStorage implementation for storing transactions. The default is SessionStorage. |
||
|
|
Optionally provide a custom TokenCache implementation for storing access tokens. The default is WebStorageTokenCache. |
||
|
|
Whether to use a refresh token rotation instead of standard auth code flow with silent authentication. 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 enabled the Proof-Key-for-Code-Exchange enhancement to the OAuth Authorization Code Flow. False by default. |
||
|
|
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
|
||
|
|
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. |
||
|
|
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. |
Params to be added to the authorization request URL.
Property | Type | Description |
---|---|---|
|
|
The client ID. |
|
|
The redirect URI. |
|
|
The scope. |
|
|
The response type, typically "code". |
|
|
The state parameter, typically a randomly generated string. |
|
|
The prompt parameter, either "login" or blank for redirect authentication, or "none" for silent authentication. |
Configuration options when building the URL for a change password request to the authorization server.
Property | Type | Description |
---|---|---|
|
|
The location to redirect to after a successful change password. Defaults to
|
Represents a request to change the currently authenticated user’s password for an embedded form as opposed to redirecting to the form hosted by the Auth Server for Universal Login.
Property | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
Configuration options when building the URL for the request to get an access token from the auth server.
Property | Type | Description |
---|---|---|
|
|
The account id for the request. |
|
|
Optionally provide application data to store until the redirect callback is handled and returns LoginRedirectResult. |
|
|
Whether to ignore the cache and always execute a request. |
|
|
The redirect URI that points to the silent callback location. The content at this URI should expect to be loaded into a hidden iframe which will post a message with the request parameters back to the parent window. |
|
|
The scope for the authorization request. |
|
|
The amount of time in seconds allowed before a timeout for the authorization request. If not provided, defaults to 10 seconds. |
Configuration options for when building the URL for the request to get the IdentityClaims for
an AccessToken
.
Property | Type | Description |
---|---|---|
|
|
The scope the token was authorized for. |
Options for configuration the request to get the latest SessionExpiry for the user scope.
Property | Type | Description |
---|---|---|
|
|
The scope the token was authorized for. |
Claims for an issued access token.
Property | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Configuration options when building the URL for a login request to the authorization server.
Property | Type | Description |
---|---|---|
|
|
The redirect URI for the authorization request. If not provided, will use the default defined in AuthClientOptions. |
|
|
The scope for the authorization request. If not provided, will use the default defined in AuthClientOptions. |
|
|
Optionally provide application data to store until the redirect callback is handled and returns LoginRedirectResult. |
|
|
The accountId for the authorization request. If not provided, will use the default defined in AuthClientOptions. Set to |
|
|
Additional custom parameters to include in the auth request. |
The result from a login-with-redirect request. This holds the state that should be validated in the app in the auth code flow flow.
Property | Type | Description |
---|---|---|
|
|
Any application data provided as part of LoginRedirectOptions. |
Additional options for the embedded login request.
Property | Type | Description |
---|---|---|
|
|
Scope to include if needing to override the default |
Represents a request to log in a user with credentials for an embedded log in form as opposed to logging in with a redirect for Universal Login.
Property | Type | Description |
---|---|---|
|
|
|
|
|
Represents a response to a login-with-credentials request. This contains the one-time-password to exchange for an access token.
Property | Type | Description |
---|---|---|
|
|
One-time-password to use in exchange for an access token |
Configuration options when building the URL for a logout request to the authorization server.
Property | Type | Description |
---|---|---|
|
|
The location to redirect to after a successful logout. Defaults to
|
Types of permissions for users. This are to be combined with security scopes
(e.g, PRODUCT
) to determine what the user is allowed to do for that scope,
e.g., READ_PRODUCT
.
Name | Value | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Configuration options when building the URL for a register user request to the authorization server.
Property | Type | Description |
---|---|---|
|
|
The location to redirect to after a successful user registration. Defaults to
|
|
|
Additional parameters to include in the redirect to the registration page |
Represents a request to register a user with credentials for an embedded form as opposed to registering with a redirect for Universal Login.
Property | Type | Description |
---|---|---|
|
|
The type of user being registered. See UserType (Enum). Default is |
|
|
Full name of the user: First Last. |
|
|
Will automatically be set to |
|
|
|
|
|
|
|
|
Must match |
|
|
True if this registration is in a preview context |
|
|
Client implementations may choose to utilize this field to accept and pass additional custom
information as part of the user registration process. By default, these attributes are passed
to interested microservices via |
The result of requesting an access token including the AccessToken and the user’s SessionExpiry.
Property | Type | Description |
---|---|---|
|
|
|
|
|
Configuration options for making a request to get an access token.
Property | Type | Description |
---|---|---|
|
|
Account ID for the current user such as in a B2B context. Only used when using embedded login. |
|
|
The client ID for the auth token request. |
|
|
Used if PKCE is enabled. |
|
|
The grant type for the auth token request. Defaults to |
|
|
The redirect URI for the auth token. |
|
|
The scope for the auth token request. |
|
|
The auth code for the auth token request. Not required only when the |
|
|
The purpose of the code. This is used for retrieving a one-time-password, in which case the purpose would be
|
|
|
When using refresh token rotation, this is used to get an access token instead |
|
|
Additional parameter to include when using embedded login along with |
Represents a request from a user to get a link emailed to them with which to reset their password. This is used when not using the Universal Login pattern and instead hosting login and registering outside of an auth server such as on a commerce site.
Property | Type | Description |
---|---|---|
|
|
Represents a request from a user to reset their password. They must include a token received after requesting a password-reset link. This is used when not using the Universal Login pattern and instead hosting login and registering outside of an auth server such as on a commerce site.
Property | Type | Description |
---|---|---|
|
|
|
|
|
Token provided after requesting to reset a password. This is used to verify the submission of the new password is from a valid user. |
|
|
The new password. |
implements WebStorage
Uses the browser session storage to store the transaction data.
The expiry for the user’s session including the inactivity
Property | Type | Description |
---|---|---|
|
|
The ISO8601 timestamp when the user’s session will expire due to inactivity. |
|
|
The ISO8601 timestamp when the will be required to login. |
Cache used to hold access tokens.
Property | Type | Description |
---|---|---|
|
|
Stores the given entry in the cache, creating the cache key based based on the values in the entry.
By default, the key is based on the |
|
|
Retrieves an entry from the cache matching the given key. By default, the key is based on the
Note that by default, this will return an entry if it is expired but the
|
|
|
Clears the cache of all entries. |
Represents an entry in the access token cache.
Property | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The key for a TokenCacheEntry in the access token cache.
Property | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
Includes the TokenCacheEntry and it’s expiration time.
Property | Type | Description |
---|---|---|
|
|
The entry for this cache record. |
|
|
The time at which this entry expires in seconds since Epoch. |
Represents an authenticated user.
Property | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The API domain that represents a scope and operation types a user has access to on that scope.
Property | Type | Description |
---|---|---|
|
|
The scope of the user operation, e.g., |
|
|
The set of operation types that are allowed for the scope. See PermissionType (Enum) |
Payload describing the operations a user is allowed to perform.
Property | Type | Description |
---|---|---|
|
|
List of UserOperations for the user. |
Represents a user permission like "Read Account Members".
Property | Type | Description |
---|---|---|
|
|
Id of the permission. |
|
|
Name of the permission. |
Represents a user role like "Account Admin".
Property | Type | Description |
---|---|---|
|
|
Id of the role. |
|
|
The name for this role. This has no purpose other than labeling, and is not guaranteed to be unique. |
|
|
The friendly name of this role for display purposes. Required for account roles. |
|
|
The description of this role for display purposes. Optional, but recommended for account roles. |
|
|
The permissions that this role has been directly assigned. The role inherits other
permissions from its ancestors as described for See UserPermission. |
The type of user, whether customer or admin.
Name | Value | Description |
---|---|---|
|
|
Indicates the user is a customer user |
|
|
Indicates the user is an admin user. |
Cache to store Auth transaction data during the OAuth Authorization Code Grant Flow such as the original request params for verifying the Auth Server’s response.
Property | Type | Description |
---|---|---|
|
|
Stores the given entry in the cache with the given cache key.
See WebStorageOptions
By default, the key is based on the |
|
|
Retrieves an entry from the cache matching the given key. |
|
|
Removes the specified entry. |
implements TokenCache.
This cache implementations stores tokens in memory as a map, and may also serialize the in-memory cache to local or session storage in the browser. Takes in CacheOptions to configure.
Configuration options for WebStorageTokenCache the default implementation of TokenCache.
Property | Type | Description |
---|---|---|
|
|
Buffer to add to the cache record’s time to live. 60 by default. |
|
|
Enables serializing the cache to local storage. False by default. |
|
|
Enables serializing the cache to session storage. False by default. |
|
|
The wait time between persisting the cache. |
|
|
The default time-to-live for elements that are cached. 0 means never expired. |
|
|
If using local or session storage, this is the name of the cache. |