Third-Party Authorized Token Login
POST/auth/v1/signin/with/provider
API Description
Log in using a provider_token generated from third-party authorization information. Supports auto-registering new users or binding to existing users.
Input Requirements
client_id: Client ID corresponding to the application (optional, defaults to environment ID)x-device-id: Device ID (required, passed in the request header)- Request body parameters (
v1SignInWithProviderRequest):provider_token:provider_token(required, obtained via the Get Third-party Authorization Info API)force_disable_sign_up: Force disable auto registration (optional, defaultfalse)sync_profile: Whether to force synchronization of nickname and other information from the third party (optional, defaultfalse)
Prerequisites
- You must first call the Get Third-party Authorization Info API to obtain a valid
provider_token. - The
provider_tokenmust still be within its validity period (default 1 hour). - The third-party identity provider must be configured and enabled in the CloudBase console.
Output
- Returns a standard token response (
access_token,refresh_token, etc.). - If the user does not exist and auto registration is enabled, a new user will be created automatically.
- If the user already exists, the third-party identity provider will be bound to the existing user.
Request Example
POST /auth/v1/signin/with/provider
x-device-id: device_123456
Content-Type: application/json
{
"provider_token": "your_provider_token",
"force_disable_sign_up": false,
"sync_profile": true
}
Response Example
{
"token_type": "Bearer",
"access_token": "your_access_token",
"refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
"expires_in": 7200,
"scope": "user sso",
"sub": "9876543210123456789"
}
Key Characteristics
- Supports seamless login via third-party authorization information.
- Supports auto-registering new users.
- Supports binding the third-party identity provider to an existing account.
- Supports synchronizing basic information such as nickname and avatar from the third party.
Request
Responses
- 200
- 500
A successful response.
Response Headers
An unexpected error response.