Anonymous Login
POST/auth/v1/signin/anonymously
API Description
Anonymous login API. A single device ID can register at most one anonymous user and generate an access_token for that anonymous user.
Input Requirements
x-device-id: Device ID (required, passed in the request header)client_id: Client ID corresponding to the application (optional, defaults to environment ID)
Prerequisites
- A single device ID can only register one anonymous user.
- The device ID must be randomly generated by the client and cached locally.
Output
- Returns a standard token response (
access_token,refresh_token, etc.). - The
scopeis"anonymous", indicating an anonymous user.
Request Example
POST /auth/v1/signin/anonymously
x-device-id: device_123456
Content-Type: application/json
{}
Response Example
{
"token_type": "Bearer",
"access_token": "your_access_token",
"expires_in": 7200,
"scope": "anonymous",
"sub": "7ft9WRremXrz-TfgoAR9Uw"
}
Key Characteristics
- A single device ID can create only one anonymous user.
- Anonymous users do not have personal information such as username or password.
- Suitable for scenarios such as trial use or guest experience.
- Can be upgraded to a regular user by binding other login methods.
Request
Responses
- 200
- 400
- 403
- 500
A successful response.
Response Headers
- invalid_argument, please add device ID in the request header, x-device-id is not passed in the Header
- unimplemented, please contact the administrator to enable anonymous login, anonymous login is not enabled, go to the Cloud Development Platform to enable it
Response Headers
Response Headers
An unexpected error response.