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. Temporary, with a lifetime that corresponds to the JWT's lifetime.

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:

Create Anonymous User Flow

Eventually, the flow will create a token that we can use as the defined anonymous identity. Sigend by Descope. This example shows an output of the flow where the "danu" claim is the indecator that this identity is in fact anonymous, and "displayName" as a custom claim that will help us inside our app:

// Payload:
{
  "danu": true,
  "displayName": "xxxxx",
  "drn": "DS",
  "exp": 1731843388,
  "iat": 1731842788,
  "iss": "xxxxxxxxx",
  "rexp": "2024-12-15T11:26:28Z",
  "sub": "xxxxxxxxx"
}
 
// Header:
{
  "alg": "RS256",
  "kid": "xxxxxxxxxxxxxxxx",
  "typ": "JWT"
}

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.

Update anonymous users magic link flow

  • 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.
Was this helpful?

On this page