Anonymous Users
Anonymous Users allow applications to gradually build out user profiles without requiring identifying information like a phone number, email, or username. This is useful for scenarios where you don't want any registration friction but would like to rely on Descope as a Customer Identity Platform (CIAM) to issue a relevant access token and to manage the user's conversion to a regular user without loosing any user gathered data. Anonymous Users are identified with a unique Descope JWT type. Temporarily, with a lifetime that corresponds to the JWT's lifetime. Read more about utilizing Descope to boost conversions with anonymous users and guest checkout.
Creating an Anonymous User
Using the "Create Anonymous user - Add Information To JWT" flow template, we are given the basic ability to create the anonymous user's identity:
Eventually, the flow will create a token that we can use as the defined anonymous identity. Signed by Descope. This example shows an output of the flow where the "danu" claim is the indicator that this identity is in fact anonymous, and "displayName" as a custom claim that will help us inside our app:
Anonymous Users with SDK
You can use Descope management SDK for common user management operations like create user, update user, delete user, etc. The management SDK requires a management key, which can be generated here. Now, specifically for anonymous users, you will be generating a JWT token to define anonymity.
Install SDK
Import and initialize Management SDK
Create an Anonymous User via SDK
This operation creates an anonymous user within the project with the details provided.
Convert Accounts to Regular
As an example, to convert accounts from anonymous to regular, the "Sign up - Magic Link - Anonymous User Conversion" flow template can be used to convert and authenticate the user.
- This flow is a demonstration of a specific authentication method.
- Be sure to verify their Login ID with a real email or phone number. This prevents users from taking over accounts that have already been created that they do not own.