QQ Login
During the QQ login API call, different results are returned depending on configuration. On normal success, the user's session_token is returned; if not bound or secondary authentication is enabled, state_token is returned; failure information is returned on failure.
Request Description
Request Headers
| Parameter Name | Chinese Name | Required | Type | Example |
|---|---|---|---|---|
| X-operating-sys-version | Caller client OS version | Yes | String | windows10.1.1 |
| X-device-fingerprint | Caller client device fingerprint | Yes | String | 156aysdna213sc50 |
| X-device-ip | Caller client IP | No | String | 192.168.1.2 |
| X-agent | User-Agent information | Yes | String | Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) |
| X-L | Used for internationalization language setting | No | String | zh |
| X-client-id | Application authorization ID | Yes | String | nTo1eRIub60vPb54WeE6aojPwYwImtl4 |
| content-type | Content format type | Yes | String | application/json |
Request Example
json
{
"access_token":"8B11C37B7894C5E2347E1606DC7CCFDC",
"open_id": "D8924F7071DC1D29A6822C794D848D9C"
}Request Parameters
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| access_token | QQ access token | Yes | String | QQ access token |
| open_id | QQ open ID | Yes | String | QQ open ID |
Response Example
Success Example1(successful match returns session_token)
HTTP/1.1 200 OK
json
{
"session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
"expire": 604800,
"status": "SUCCESS",
"id_token": "eyJraWQiOiJrMSIsImFsZyI6IlJTMjU2In0.eyJpc3MiOiJJc3N1ZXIiLCJhdWQiOiJBdWRpZW5jZSIsImV4cCI6MTY1MzQ4NDQxMiwianRpIjoieUxSVGZXY1VkYk9PeUFpbHdZU0ZqZyIsImlhdCI6MTY1MzQ2NjQxMiwibmJmIjoxNjUzNDY2MjkyLCJzdWIiOiJzdWJqZWN0IiwiYXBpIjoie1wibmFtZVwiOlwiXCIsXCJtb2JpbGVcIjpcIis4Ni0xNTkwNzEzMjg1MlwiLFwiaWRcIjpcIjIwMjIwNDI1MTQwMTM4NTE5LUJGMUItNTI4QjA1NTFCXCIsXCJ1c2VyTmFtZVwiOlwibG91eGlcIixcImVtYWlsXCI6XCIxMUBxcS5jb21cIn0ifQ.al79knH1fKa4aT4AFr_FMjqBKu2pV_g-lKzzgHzmor5X-dHwSBUtjH38KOzjIqHvkcRMjXQuBnWmjRI7-0Djn2LuWVueaf3wRXLscCWiSDC7chjUyTRXMatYINxdvW-oSWFYGFqqbdsavLqOnvehd7ahEaTuiL9yZolvslZIkIxjxBJJu7A9Ln2sk3wf9pxXU83jIJ8ubPQBoVS-ilerTTJOKDZ9XsL2ftJsaqdTJK_mYbvKaVpLIVyHHJ2NcF6f-Al4N4kc8cgxtSgSKFDcR7Bz7dYlOcfUXCPAzJ3NZInm8UaksiWU02tvlvTRvRdoxZNnvD5vamZ5hjFc-cW5jA"
}Success Example2(returns auto-registration and binding flow)
HTTP/1.1 200 OK
json
{
"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJzb2NpYWxVaWRcIjpcIm8zRHVFNVNySXVodTlIZHFucHd0c3Y5a2dkSFFcIixcInN0YXR1c1wiOlwiVVNFUl9SRUdJU1RFUlwifSIsImV4cCI6MTY0NjcwNTcwNCwiaWF0IjoxNjQ2NzAzOTA0LCJqdGkiOiIxNjQ2NzAzOTA0NTEwMCJ9.tLEpS-9jrXwiJI3GlZw4RGg_z0zMDzKMMZtPBv2VPS8",
"data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
"status": "USER_REGISTER"
}Success Example3(returns binding flow)
HTTP/1.1 200 OK
json
{
"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJzb2NpYWxVaWRcIjpcIm8zRHVFNVNySXVodTlIZHFucHd0c3Y5a2dkSFFcIixcInN0YXR1c1wiOlwiVVNFUl9SRUdJU1RFUlwifSIsImV4cCI6MTY0NjcwNTcwNCwiaWF0IjoxNjQ2NzAzOTA0LCJqdGkiOiIxNjQ2NzAzOTA0NTEwMCJ9.tLEpS-9jrXwiJI3GlZw4RGg_z0zMDzKMMZtPBv2VPS8",
"data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
"status": " SOCIAL_BIND"
}Success Example4(returns secondary authentication flow)
json
HTTP 200 OK
{
"status": "MFA_AUTH",
"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJ1c2VySWRcIjpcIjIwMjIwMTIwMDk0MzEwNDM0LTg0N0MtQTFEOUJGOUIwXCIsXCJzdGF0dXNcIjpcIk1GQV9BVVRIXCJ9IiwiZXhwIjoxNjQ0MzkyNTEyLCJpYXQiOjE2NDQzOTA3MTIsImp0aSI6IjE2NDQzOTA3MTI2MDEwIn0.PcwlKPlPgIwnPZUE_s56_x5zB8YKaivfkpT0Fm5D2vU",
"data": "[\"SMS\"]"
}Success Example5(returns access-denied flow)
json
HTTP 200 OK
{
"status": "ACCESS_DENIED",
"data": "拒绝访问"
}Error Example
HTTP/1.1 400 Bad Request
json
{
"error_code": "IDAAS.SDK.PARAM.0001",
"error_msg": "Device information is incomplete"
}Response Parameters
| Parameter Name | Chinese Name | Type | Description |
|---|---|---|---|
| status | Login flow status identifier | String | Possible values returned by this field are as follows: SUCCESS: login successful SOCIAL_BIND: binding flow USER_REGISTER: auto-registration and binding flow ACCESS_DENIED: access denied MFA_AUTH: login process requires secondary authentication |
| expire | session_token validity period | Number | session_token validity period,Within the validity period, session_token can be used to obtain ticket |
| session_token | User session_token | String | User session_token; this token can be used to call IDaaS APIs to obtain ticket, which can be exchanged for user information |
| state_token | User state token | String | User state token |
| data | Return description | String | Tenant social registration and binding flow configuration information; the socialBindOrRegisterFlow field contains the verification methods supported by the tenant VERIFY_PHONE: mobile number + SMS verification code VERIFY_EMAIL: email + email verification code |
| id_token | Short-term valid API call credential | String | This field is a JWT that stores user information and application scope information; it needs to be verified after acquisition. It is valid for 2 hours by default and can be configured |
Error Codes
| Status Code | Error Codes | Chinese Error Message | English Error Message | Resolution |
|---|---|---|---|---|
| 400 | IDAAS.SDK.PARAM.0001 | 设备信息不完整 | Device information is incomplete | Please check whether the input device information is complete |
| 400 | IDAAS.SDK.PARAM.0002 | clientId不能为空 | clientId cannot be empty | Please check whether the input clientId is empty |
| 400 | IDAAS.SDK.PARAM.0003 | 应用未注册,请先注册应用 | The app is not registered, please register the app first | Please check whether the input clientId is correct |
| 400 | IDAAS.SDK.PARAM.0024 | QQ授权令牌不能为空 | QQ access token cannot be empty | Please check whether the input QQ access token is empty |
| 400 | IDAAS.SDK.PARAM.0025 | QQ用户标识ID不能为空 | QQ open ID cannot be empty | Please check whether the input QQ open ID is empty |
| 400 | IDAAS.SDK.USER.0001 | 用户未找到 | User not found | Please register first and try again |
| 400 | IDAAS.SDK.USER.0039 | 用户已被禁用 | User is disabled | Please contact the administrator |
| 500 | IDAAS.SDK.COM.0002 | 系统繁忙,请稍后再试 | System busy, please try again later | Please call again or contact BambooCloud staff |