Customer Identity (CIAM)

Alipay Mini Program Login

Call this interface when using Alipay Mini Program login.

# Request Description

POST https://{your_domain}/api/v2/sdk/login/alipay-miniprogram

# Request Headers

Parameter 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":" 091zQTFa1i6qMC02AWFa1Vzt0O0zQTF8"
}
1
2
3

# Request Parameters

Parameter Name Chinese Name Required Type Description
code Alipay Mini Program Login Code Yes String The login code returned by the Alipay Mini Program login

# Response Example

Success Example 1 (Returns session_token upon successful user match):
HTTP/1.1 200 OK
Content-Type: application/json
{
    "session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
    "expire": 432000,
    "status": "SUCCESS"
}

Success Example 2 (Returns auto-register and bind flow):
HTTP/1.1 200 OK
Content-Type: application/json
{
    "state_token": "eyJhbGcCJ9.eyJzdWMCJ9…tL2VPS8",
    "data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
    "status": "USER_REGISTER"
}

Success Example 3 (Returns bind flow):
HTTP/1.1 200 OK
Content-Type: application/json
{
    "state_token": "eyJhbGcCJ9.eyJzdWMCJ9…tL2VPS8",
    "data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
    "status": " SOCIAL_BIND"
}
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

# Response Parameters

Parameter Name Chinese Name Type Description
status Login Flow Status Identifier String SUCCESS: Login successful
SOCIAL_BIND: Bind flow
USER_REGISTER: Auto-register and bind flow
ACCESS_DENIED: Access denied
MFA_AUTH: Secondary authentication
expire session_token Validity Period Number Session_token validity period
session_token User session_token String User session_token
data Return Description String Configuration information for the tenant's social registration and binding flow. The content of the socialBindOrRegisterFlow field is the verification methods supported by the tenant.
VERIFY_PHONE: Phone number + SMS verification code
VERIFY_EMAIL: Email + email verification code
state_token Login State Token String A token with state, used for the process of binding the Alipay user ID to the user's phone number or username