Customer Identity (CIAM)

WeChat Mini Program Mobile Login

Call this interface when using WeChat Mini Program authorized mobile number login. When calling this interface, note that the Mini Program version must be above 2.21.2.

# Request Description

POST https://{your_domain}/api/v2/sdk/login/wechat-mini-program-mobile

# Request Headers

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

{
    "code":" 6082b2e9bb01b3b734b1a1a1ff8d3f0f35340ef23bff7d71cdb4d2d45b637c4e"
}
1
2
3

# Request Parameters

Parameter Name Chinese Name Required Type Description
code WeChat Mini Program Phone Number Authorization Code Yes String The authorization code returned by the WeChat Mini Program phone number authorization.

# Response Example

Success Example (Returns session_token and id_token upon successful user match):
HTTP/1.1 200 OK
Content-Type: application/json
{
    "session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
    "expire": 432000,
    "status": "SUCCESS",
    "id_token": "eyJraWQn0.eyJpc3MiOiJodHR…g1A7jG8O0uw"
}
1
2
3
4
5
6
7
8
9

# Response Parameters

Parameter Name Chinese Name Type Description
status Login Process Status Identifier String SUCCESS: Login successful
expire session_token Validity Period Number Session_token validity period
session_token User session_token String User session_token
id_token Identity token for the logged-in user, short-term validity String This field is in JWT format and contains user identity information. Please refer to Get User Info from id_token to obtain user information. The token's validity period defaults to 5 minutes.