User Authorization via H5
Call the API to obtain the authorization code via H5 page. The authorization code can be used to obtain the access token, so as to obtain the app user's information, such as user name and id card number.
Request Sample
<script>
AlipayJSBridge.call('getAuthCode', {
"appId": "NIPDMFPPSMDO",
"authClientId": '2160127301282681',
"scopeNicks": ["USER_NAME", "USER_ID_CARD_NO"],
"scene": "merchantOauth"
}, function (result) {
console.log(result);
});
</script>
Parameters
Property | Type | Required | Description |
scopeNicks | Array | Yes | The scope of authorization. For more information about its valid values, refer to Scope description. |
appId | String | Yes | The appId about the application Id. |
authClientId | String | Yes | The authClientId about the HK merchant Id. |
scene | String | Yes | The scene of authorization. By default ues "merchantOauth". |
Scopes description
Valid value | Description |
USER_NAME | Authorized to obtain user name. |
USER_ID_CARD_NO | Authorized to obtain user ID card number. |
Error Code
Valid value | Description |
3 | No Authorization Result |
11 | Cancel Authorization by User |
12 | Network Error |
13 | Authorization Timeout |
14 | User Authorization Timeout |
15 | System Error |
101 | No eKYC |