Customer Identity (CIAM)

Social Account Registration and Mobile/Email Binding Interface

Interface

This interface is called when a user who has not bound a system mobile number or email logs in with a social account, and the authentication source is configured for binding or registration.

# Request Description

Request URL https://{your_domain}/api/v2/sdk/social/register-bind

Request Method POST

Content-Type application/json

# Request Header Parameters

Parameter Chinese Name Required Type Example
X-operating-sys-version Caller OS Version Yes String windows10.1.1
X-device-fingerprint Caller Device Fingerprint Yes String 156aysdna213sc50
X-device-ip Caller 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) AppleWebKit/605.1.15(KHTML, like Gecko)
Mobile/15E148/HuaWei-AnyOffice/2.6.1802.0010/com.huawei.cloudlink.workplace
X-L For Internationalization Language Setting No String zh
X-client-id Application Authorization ID Yes String nTo1eRIub60vPb54WeE6aojPwYwImtl4
X-state-token Temporary Token Yes String eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdW...

# Request Body Example

1、Using mobile number + SMS verification code

{
    "mobile":"15201657321",
    "verify_code":"123456"
}
1
2
3
4

# Request Parameters

Parameter Chinese Name Required Type Description
mobile Mobile Number Yes String Mobile number receiving the verification code
verify_code Verification Code Yes String Received verification code
Refer to the Send SMS Verification Code Interface type=REGISTER_SMS for obtaining the verification code
  1. Using Email + Email Verification Code
{
  "email":"zhangsan@qq.com",
  "verify_code":"123456"
}
1
2
3
4
Parameter Name Chinese Name Required Type Description
email Email Yes String The email address receiving the verification code
verify_code Verification Code Yes String The received verification code
To get the verification code, please refer to the Send Email Verification Code API type=REGISTER_EMS

# Response Example

Success Example:
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"
}
Error Example:
HTTP/1.1 400 Bad Request
{
    "error_code": "IDAAS.SDK.COMMON.1007",
    "error_msg": "state_token parameter error"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

# Response Parameters

Parameter Name Chinese Name Type Description
status Result String Possible return values for this field are as follows:
SUCCESS Login successful
expire session_token validity period Number The validity period of the session_token. The session_token can be used to obtain a ticket within this period.
session_token User session_token String User session_token, which can be used to call IDaaS APIs to obtain an sso_ticket. The sso_ticket can be exchanged for user information.
id_token Short-term effective, API call credential String This field is a JWT containing user information and the application's scope information. It needs to be verified and signed to obtain. It is valid for 2 hours by default and supports configuration.

# Error Codes

Status Code Error Code Error Message Handling Measures
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 not registered, please register the application first
400 IDAAS.SDK.PARAM.0015 IdToken cannot be empty Please check if the input IdToken is empty
IdToken cannot be empty
400 IDAAS.SDK.PARAM.0016 IdToken is invalid or expired Please try again after obtaining a new IdToken
IdToken is invalid or has expired
400 IDAAS.SDK.PARAM.0017 Social ID cannot be empty Please check if the input Social ID is empty
Social ID cannot be empty

Please paste the Markdown content you need translated.