Customer Identity (CIAM)

Weibo Login

During the Weibo login interface call, different results are returned based on the configuration. A successful normal call returns the user's session_token; if not bound or secondary authentication is enabled, it returns a state_token; failure returns error information.

# Request Description

POST https://{your_domain}/api/v2/sdk/login/weibo

# Request Headers

Parameter Chinese Name Required Type Example
X-operating-sys-version Client Operating System Version Yes String windows10.1.1
X-device-fingerprint Client Device Fingerprint Yes String 156aysdna213sc50
X-device-ip 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 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

{
    "access_token":"8B11C37B7894C5E2347E1606DC7CCFDC",
    "uid": "D8924F7071DC1D29A6822C794D848D9C"
}
1
2
3
4

# Request Parameters

Parameter Name Chinese Name Required Type Description
access_token Weibo Authorization Token Yes String Weibo Authorization Token
uid Weibo User ID Yes String Weibo User ID

# Response Example

Success Example 1 (Successfully matched user returns session_token):
HTTP/1.1 200 OK
Content-Type: application/json
{
	"session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
	"expire": 604800,
	"status": "SUCCESS",
	"id_token": "eyJraWQiOiJrMSIsImFsZyI6IlJTMjU2In0.eyJpc3MiOiJJc3N1ZXIiLCJhdWQiOiJBdWRpZW5jZSIsImV4cCI6MTY1MzQ4NDQxMiwianRpIjoieUxSVGZXY1VkYk9PeUFpbHdZU0ZqZyIsImlhdCI6MTY1MzQ2NjQxMiwibmJmIjoxNjUzNDY2MjkyLCJzdWIiOiJzdWJqZWN0IiwiYXBpIjoie1wibmFtZVwiOlwiXCIsXCJtb2JpbGVcIjpcIis4Ni0xNTkwNzEzMjg1MlwiLFwiaWRcIjpcIjIwMjIwNDI1MTQwMTM4NTE5LUJGMUItNTI4QjA1NTFCXCIsXCJ1c2VyTmFtZVwiOlwibG91eGlcIixcImVtYWlsXCI6XCIxMUBxcS5jb21cIn0ifQ.al79knH1fKa4aT4AFr_FMjqBKu2pV_g-lKzzgHzmor5X-dHwSBUtjH38KOzjIqHvkcRMjXQuBnWmjRI7-0Djn2LuWVueaf3wRXLscCWiSDC7chjUyTRXMatYINxdvW-oSWFYGFqqbdsavLqOnvehd7ahEaTuiL9yZolvslZIkIxjxBJJu7A9Ln2sk3wf9pxXU83jIJ8ubPQBoVS-ilerTTJOKDZ9XsL2ftJsaqdTJK_mYbvKaVpLIVyHHJ2NcF6f-Al4N4kc8cgxtSgSKFDcR7Bz7dYlOcfUXCPAzJ3NZInm8UaksiWU02tvlvTRvRdoxZNnvD5vamZ5hjFc-cW5jA",
}

Success Example 2 (Returns automatic registration and binding flow):
HTTP/1.1 200 OK
Content-Type: application/json
{
	"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJzb2NpYWxVaWRcIjpcIm8zRHVFNVNySXVodTlIZHFucHd0c3Y5a2dkSFFcIixcInN0YXR1c1wiOlwiVVNFUl9SRUdJU1RFUlwifSIsImV4cCI6MTY0NjcwNTcwNCwiaWF0IjoxNjQ2NzAzOTA0LCJqdGkiOiIxNjQ2NzAzOTA0NTEwMCJ9.tLEpS-9jrXwiJI3GlZw4RGg_z0zMDzKMMZtPBv2VPS8",
	"data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
	"status": "USER_REGISTER"
}

Success Example 3 (Returns binding flow):
HTTP/1.1 200 OK
Content-Type: application/json
{
	"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJzb2NpYWxVaWRcIjpcIm8zRHVFNVNySXVodTlIZHFucHd0c3Y5a2dkSFFcIixcInN0YXR1c1wiOlwiVVNFUl9SRUdJU1RFUlwifSIsImV4cCI6MTY0NjcwNTcwNCwiaWF0IjoxNjQ2NzAzOTA0LCJqdGkiOiIxNjQ2NzAzOTA0NTEwMCJ9.tLEpS-9jrXwiJI3GlZw4RGg_z0zMDzKMMZtPBv2VPS8",
	"data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
	"status": " SOCIAL_BIND"
}

Success Example 4 (Returns secondary authentication flow):
HTTP 200 OK
{
	"status": "MFA_AUTH",
	"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ7XCJ1c2VySWRcIjpcIjIwMjIwMTIwMDk0MzEwNDM0LTg0N0MtQTFEOUJGOUIwXCIsXCJzdGF0dXNcIjpcIk1GQV9BVVRIXCJ9IiwiZXhwIjoxNjQ0MzkyNTEyLCJpYXQiOjE2NDQzOTA3MTIsImp0aSI6IjE2NDQzOTA3MTI2MDEwIn0.PcwlKPlPgIwnPZUE_s56_x5zB8YKaivfkpT0Fm5D2vU",
	"data": "[\"SMS\"]"
}

Success Example 5 (Returns login denial flow):
HTTP 200 OK
{
    "status": "ACCESS_DENIED",
    "data": "Access Denied"
}


Error Example:
HTTP/1.1 400 Bad Request
{
    "error_code": "IDAAS.SDK.PARAM.0001",
    "error_msg": "Device information is incomplete"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

# Return Parameters

Parameter Name Chinese Name Type Description
status Login Process Status Identifier String Possible values for this field are:
SUCCESS Login successful
SOCIAL_BIND Binding process
USER_REGISTER Auto-registration binding process
ACCESS_DENIED Access denied
MFA_AUTH Login succeeded but requires secondary authentication
expire session_token Validity Period Number session_token validity period; within this period, session_token can be used to obtain a ticket
session_token User session_token String User session_token, which can be used to call IDaas interfaces to obtain a ticket; the ticket can be exchanged for user information
state_token User Stateful Token String User Stateful Token
data Return Description String Configuration information for the tenant's social registration and binding process. The content of the socialBindOrRegisterFlow field indicates the verification methods supported by the tenant.
VERIFY_PHONE: Phone number + SMS verification code
VERIFY_EMAIL: Email + email verification code
id_token Short-term valid, interface call credential String This field is a JWT containing user information and the application's scope information, which needs to be verified and decoded to obtain. It is valid for 2 hours by default and is configurable.

# Error Codes

Status Code Error Code Error Message Action
400 IDAAS.SDK.PARAM.0001 Device information is incomplete Please check if the input device information is complete.
Device information is incomplete
400 IDAAS.SDK.PARAM.0002 clientId cannot be empty Please check if the input clientId is empty.
clientId cannot be empty
400 IDAAS.SDK.PARAM.0003 The app is not registered, please register the app first Please check if the input clientId is correct.
Application is not registered, please register the application first.
400 IDAAS.SDK.PARAM.0026 Weibo access token cannot be empty Please check if the Weibo authorization token is empty.
Weibo authorization token cannot be empty.
400 IDAAS.SDK.PARAM.0027 Weibo user ID cannot be empty Please check if the Weibo user ID is empty.
Weibo user ID cannot be empty.
400 IDAAS.SDK.USER.0001 User not found Please register and try again.
User not found.
400 IDAAS.SDK.USER.0039 User is disabled Please contact the administrator.
User has been disabled.
500 IDAAS.SDK.COM.0002 System busy, please try again later Please retry the call or contact Zhuyun staff.
System is busy, please try again later.