prompt=none
parameter on the authentication request that allows applications to indicate that the must not display any user interaction (such as authentication, consent, or ). Auth0 will either return the requested response back to the application, or return an error if the user is not already authenticated or if some type of consent or prompt is required before proceeding.
Use of the Implicit Flow in SPAs presents security challenges requiring explicit mitigation strategies. You can use the Authorization Code Flow with PKCE in conjunction with Silent Authentication to renew sessions in SPAs.
prompt=none
parameter when you redirect a user to the /authorize
endpoint of Auth0’s authentication API. (The individual parameters on the authentication request will vary depending on the specific needs of your app.)
For example:
prompt=none
parameter causes Auth0 to immediately send a result to the specified redirect_uri
(callback URL) using the specified response_mode
with one of two possible responses: success or error.
response_type=id_token token
, used for single-page applications), Auth0 will respond with the requested tokens:
prompt=none
parameter.
redirect_uri
(callback URL) with an error:
ERROR_CODE
are defined by the OpenID Connect specification:
Response | Description |
---|---|
login_required | The user was not logged in at Auth0, so silent authentication is not possible. This error can occur based on the way the tenant-level Log In Session Management settings are configured; specifically, it can occur after the time period set in the Require log in after setting. See Configure Session Lifetime Settings for details. |
consent_required | The user was logged in at Auth0, but needs to give consent to authorize the application. |
interaction_required | The user was logged in at Auth0 and has authorized the application, but needs to be redirected elsewhere before authentication can be completed; for example, when using a redirect rule. |
prompt=none
parameter to authenticate.
checkSession
method from auth0.js uses a silent token request in combination with response_mode=web_message
for SPAs so that the request happens in a hidden iframe. With SPAs, Auth0.js handles the result processing (either the token or the error code) and passes the information through a callback function provided by the application. This results in no UX disruption (no page refresh or lost state).
expires_in
response parameter returned by Auth0.expires_in
parameter is returned by Auth0 as a hash parameter following a successful authentication. In the Authorization Code Flow with PKCE, it is returned to the backend server when performing the authorization code exchange.
The expires_in
parameter indicates how many seconds the Access Token will be valid for, and can be used to anticipate expiration of the Access Token.
timeout
error response which indicates that timeout during executing web_message
communication has occurred. This error is typically associated with fallback to cross-origin authentication. To resolve, make sure to add all of the URLs from which you want to perform silent authentication in the Allowed Web Origins field for your Application using the .
checkSession()
to see if a session exists. If the session does not exist, you can then log the user out of the application. The same polling method can be used to implement silent authentication for a Single Sign-on (SSO) scenario.
The poll interval between checks to checkSession()
should be at least 15 minutes between calls to avoid any issues in the future with rate limiting of this call.
prompt=none
) to renew short-lived Access Tokens in a SPA during the duration of a user’s session without having to rely on setting allowRememberBrowser
to true
.