Username/Password/Phone Verification Code/Email Verification Code Login API
POST/auth/v1/signin
- Username/password login, pass username, password;
- Phone number verification code login, pass verification_token
- Email verification code login, pass verification_token
Request
Query Parameters
Client ID corresponding to the application, can be obtained from Cloud Development Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
Header Parameters
Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
- application/json
Body
Required when logging in with username and password. 2-48 characters, supports English uppercase and lowercase letters, numbers, special characters (only -_.:+ @), does not support Chinese
Required when logging in with username and password
Required when logging in with verification code. When logging in with phone verification code, the verification code token returned after verification
Responses
- 200
- 400
- 501
Response Headers
- application/json
- Schema
- Example (from schema)
- Example
Schema
Uniformly return Bearer
Token used to access Cloud Development HTTP API, length within 4096 bits
access_token can be refreshed to get a new access_token when it expires through refresh_token, expiration time defaults to 31 days. Length within 128 bits
Expiration time of access_token, in seconds
{
"token_type": "string",
"access_token": "string",
"refresh_token": "string",
"expires_in": 0,
"scope": "string",
"sub": "string",
"groups": [
"string"
]
}
{
"token_type": "Bearer",
"access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjlkMWRjMzFlLWI0ZDAtNDQ4Yi1hNzZmLWIwY2M2M2Q4MTQ5OCJ9.eyJpc3MiOiJodHRwOi8vbG93Y29kZS01ZzlhYzIwdTJhMjdkYTQ2LmFwLXNoYW5naGFpLnRjYi1hcGkudGVuY2VudGNsb3VkYXBpLmNvbSIsInN1YiI6IjE4NDk3NTUxMTk4NDA0OTc2NjQiLCJhdWQiOiJsb3djb2RlLTVnOWFjMjB1MmEyN2RhNDYiLCJleHAiOjE3MzQ2NzU4ODksImlhdCI6MTczNDY2ODY4OSwiYXRfaGFzaCI6InIudjVEQk10MjJSRWVHeGZ0a3VOVTFOZyIsInNjb3BlIjoidXNlciBzc28iLCJwcm9qZWN0X2lkIjoibG93Y29kZS01ZzlhYzIwdTJhMjdkYTQ2IiwicHJvdmlkZXJfdHlwZSI6ImVtYWlsIiwibWV0YSI6eyJ3eE9wZW5JZCI6IiIsInd4VW5pb25JZCI6IiJ9LCJ1c2VyX3R5cGUiOiIifQ.hOKXMtMmtbeyZSlnlprXIGVtKpBw8t7Syq45sqMX3oC2TqZ4Gl4AieQCyQF6KMLh4BH3PHt_eoJxJGQYJXx-bXalP_S94A22KpiB0n5tVb8MAV_8YbTT0oNgQeQMkGgfMMfEECle82daASgxEIHUO0UyhY0mC3O3FoGpO6rrOXVL_mOCd3Ij80dMy59XjEJn3wmnnIS3bMLAIM2GodUYT9s9C1z_p6JPWlCbxlTxst6q_lHGwvpcO8UxWvra8zQbfStn0Kej3anEYfnuWYcgLAfkAPv3eeWHii0_nLTC300Kwnhk4RCFQ7U89XHoJ4O773DeA9c4ZFdXjHicysBDUQ",
"refresh_token": "m.O0pi9CPvtWeMfpEOYrjDkYiqY5fgs1FuMhE",
"expires_in": 7200,
"sub": "1849755119840497664"
}
- invalid_username_or_password, incorrect username or password
- captcha_required, too many login attempts, requires verification code
- password_not_set, user password not set, needs to be set
- invalid_status, account locked due to too many retries, please try again later
Response Headers
X-Request-Id string
Example: 1e55ed89-4a2b-47f8-b7de-27b4775c2adbRequest ID
- application/json
- Schema
- Example (from schema)
- Example
Schema
{
"error": "string",
"error_code": 0,
"error_description": "string"
}
{
"error": "invalid_username_or_password",
"error_code": 4043,
"error_description": "Username or password incorrect."
}
- username login is disabled by admin, username/password login is not enabled, go to https://tcb.cloud.tencent.com to enable identity authentication function
Response Headers
- application/json
- Schema
- Example (from schema)
- Example
Schema
{
"error": "string",
"error_code": 0,
"error_description": "string"
}
{
"error": "unimplemented",
"error_code": 12,
"error_description": "username login is disabled by admin"
}