Prerequisites
To use anonymous sessions:- You must have an Auth0 account.
- Register your Auth0 application. If you do not have an Auth0 application, you can get started with the Auth0 React or Next.js Quickstarts.
- Register an API (resource server).
Auth0 Management API
Configure anonymous sessions in your Auth0 tenant
To set the anonymous sessions lifetime and token format, make aPATCH request to the /api/v2/tenants/settings endpoint:
Enable anonymous sessions in your application
To enable anonymous sessions in your Auth0 application, make aPATCH request to the /api/v2/clients/{id} endpoint:
Enable anonymous access in your API
To enable anonymous sessions in your API, make aPATCH request to the /api/v2/resource-servers/{id} endpoint:
Create an anonymous session
Once anonymous sessions are configured in your tenant, application, and API, you can create an anonymous session by making aPOST request to the /anonymous/token endpoint:
session_token and an access_token:
Next steps
- Anonymous Sessions Use Cases Learn about anonymous sessions use cases.