GenerateAliyunBidCertWaysUrl
更新时间:
复制 MD 格式
Call the GenerateAliyunBidCertWaysUrl operation to add identity verification information for a customer of a reseller.
Access instructions
When you call the GenerateAliyunBidCertWaysUrl operation, the AccessKeyId in the common request parameters must be the key ID of the reseller's Alibaba Cloud account.
GenerateAliyunBidCertWaysUrl is a POP API. You can call this operation by sending an HTTP POST request. The following code provides a request example:
https://aas.aliyuncs.com/?Action=GenerateAliyunBidCertWaysUrl&Platform=pc&BidType=LIGHTWEIGHT&Timestamp=2021-09-28T09%3A35%3A30Z&Source=BID&Format=JSON&SubjectType=all&SignatureNonce=a193d4b3-e54b-40f7-9d22-62107514cedd&IsOpenApp=true&AliyunPk=10****4893&IsMobile=true&<Common request parameters>The operation returns a URL that is valid for 3 hours. You can use this URL to directly complete the identity verification process.
Parameters
Common parameters
| Field name | Field type | Required | Description |
| Format | String | Yes | The format of the return value. Valid values: JSON and XML. Default value: XML. |
| Version | String | Yes | Set this parameter to 2015-07-01. |
| AccessKeyId | String | Yes | The AccessKey ID used to access the service. When you call this API, this parameter must be the key ID of the reseller partner's Alibaba Cloud account. |
| Signature | String | Yes | The signature string. For more information about how to calculate a signature, see Signature mechanism. |
| SignatureMethod | String | Yes | The signature method. Only HMAC-SHA1 is supported. |
| Timestamp | String | Yes | The timestamp of the request. The date must follow the ISO 8601 standard and be in UTC. The format is YYYY-MM-DDTHH:MM:SSZ. For example, 2016-05-23T12:00:00Z corresponds to 20:00:00 on May 23, 2016 (UTC+8). |
| SignatureVersion | String | Yes | The signature algorithm version. The current version is 1.0. |
| SignatureNonce | String | Yes | A unique random number used to prevent replay attacks. Use a different random value for each request. |
Business parameters
| Field Name | Field type | Required | Description | Example | Description |
| action | String | Required | API name | GenerateAliyunBidCertWaysUrl | The name of the API. Set this to GenerateAliyunBidCertWaysUrl. |
| AliyunPk | String | Required | UID of the Alibaba Cloud account | 123*******789 | The digital ID of the identity-verified Alibaba Cloud account |
| BidType | String | Required | Reseller type | LIGHTWEIGHT | The reseller type. NORMAL: A standard reseller (default). LIGHTWEIGHT: A lightweight reseller. |
| Platform | String | Required | The platform type of the business. | pc | Three values are available: pc (the URL is opened on a computer), h5 (the URL is opened in an H5 page), and app (the URL is opened in an app). |
| SubjectType | String | Required | Verification type | all | Three values are available: all (allows both individual and enterprise identity verification), personal (allows only individual identity verification), and enterprise (allows only enterprise identity verification). |
| Source | String | Required | Business source | BID | Set this to BID. |
| IsOpenApp | Boolean | Required | Specifies whether to wake up the Alipay app for quick verification. This is usually set to true on mobile clients. | true | true or false |
| IsMobile | Boolean | Required | Specifies whether the Alipay authorization page uses a mobile-friendly layout for quick verification. This is usually set to true on mobile clients. | true | true or false |
Return values
| Field | Description |
| RequestId | The request ID, used to track the request. |
| Data | The URL for identity verification. Display this URL in your reseller system. |
| Success | Indicates whether the request was successful. A value of true indicates success. A value of false indicates failure. |
| Code | The error code. |
| Message | The error message returned when Success is false or empty. |
// Sample success response
{
"RequestId":"7A4326A9-5B17-5BB2-B95D-4CE1EAAD55B9",
// Open this URL directly on the corresponding platform.
"Data":"https://account.aliyun.com/cert/listCertWays.html?token=YWxpeXVuSWxxxxxxxxxxdXRQa2RGY0R4Q3BoVjZ5M3ZuemdHRQ==",
"Success":true
}
// Sample failure response
{
"RequestId":"382AD1A2-0641-55EB-A113-395A45AC80C7",
"Message":"Specified signature is not matched with our calculation. server string to sign is:POST&%2F&AccessKeyId%3DLTxxxxxxg0N7cz5%26Action%3DGenerateAliyunBidCertWaysUrl%26AliyunPk%3D1039740447764893%26BidType%3DLIGHTWEIGHT%26Format%3Djson%26IsMobile%3Dtrue%26IsOpenApp%3Dtrue%26Platform%3Dpc%26SignatureMethod%3DHmac-SHA1%26SignatureNonce%3Dcac135a3-a3f3-4b11-9cc8-2479bd2c4fb2%26SignatureVersion%3D1.0%26Source%3Decs%26SubjectType%3Dall%26Timestamp%3D2021-09-28T09%253A37%253A17Z%26Version%3D2015-07-01",
"Code":"SignatureDoesNotMatch"
}
Error messages
| HttpCode | Error code | Error message | Description |
| 400 | Empty PK | The input parameter 'PK' mandatory for processing this request is not supplied. | The PK cannot be empty. |
| 403 | Not Bid | The interface can not be called by a non-bid account | The caller is not a reseller account. |
| 403 | Bid Mismatch | Pk is not belong to the Bid. | The target account does not belong to this reseller. The specified Alibaba Cloud PK was not created by this reseller. |
| 404 | Invalid PK | The specified parameter 'PK' does not exist in our records. | The account that corresponds to the specified PK does not exist. |
| 400 | Already Certified | Account is already certified | This account is already verified. The existing information will not be overwritten. |
| 404 | InvalidApi.NotFound | InvalidApi.NotFound | The reseller platform must contact the API provider through a customer business manager (CBM) to grant API permissions based on the reseller's Alibaba Cloud account UID. Otherwise, the InvalidApi.NotFound error occurs. |
| 404 | InvalidAccessKeyId.NotFound | InvalidAccessKeyId.NotFound | The specified AccessKeyId does not exist. |
| 400 | SignatureNonceUsed | SignatureNonceUsed | This error is returned if the same SignatureNonce is used in a request within 15 minutes. If you encapsulate requests, ensure that each request uses a unique SignatureNonce. We recommend that you use a UUID as the SignatureNonce. |
| 400 | SignatureDoesNotMatch | SignatureDoesNotMatch | The signature calculation is incorrect. Confirm the signature algorithm. |
Frontend integration
Embed FastAuthc
// src is the link that you obtain from the API.
<iframe src={src} />Listen for FastAuthc events
// Because FastAuthc is integrated into your application as an IFrame, use events for two-way communication.
window.addEventListener("message", (e) => {
const { data } = e;
console.log(data);
})Data structure
// The following shows the data structure of the message sent by FastAuthc.
// The data structure is as follows:
{
success: boolean;
type: MessageType;
data: any; // Additional information
}
// MessageType indicates when FastAuthc sends a message.
export enum MessageType {
INIT = "aliyun_fast_auth_init", // Page initialization
LATER = "aliyun_fast_auth_later", // Verify later
ANOTHER_AUTHC_WAY = "aliyun_fast_auth_another_authc_way", // Select another verification method
AUTHC_SUCCESS = "aliyun_fast_auth_success", // Verification successful
AUTHC_FAIL = "aliyun_fast_auth_fail", // Verification failed
RE_AUTHC = "aliyun_fast_auth_re_authc", // Re-verify
OPEN_ALIPAY = "aliyun_fast_auth_open_alipay", // Open Alipay verification page
}// Example of a failed verification
{
success: true,
type: "fail",
data: {
reason: "Reason for verification failure",
},
}// Other cases
{
success: true,
type: The corresponding MessageType,
data: {},
}Appendix
For more information about signatures, see https://help.aliyun.com/document_detail/91847.htm#concept-2041363.
For more information about common parameters, see https://help.aliyun.com/document_detail/91846.html.
该文章对您有帮助吗?