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 nameField typeRequiredDescription
FormatStringYesThe format of the return value. Valid values: JSON and XML. Default value: XML.
VersionStringYesSet this parameter to 2015-07-01.
AccessKeyIdStringYesThe 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.
SignatureStringYesThe signature string. For more information about how to calculate a signature, see Signature mechanism.
SignatureMethodStringYesThe signature method. Only HMAC-SHA1 is supported.
TimestampStringYesThe 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).
SignatureVersionStringYesThe signature algorithm version. The current version is 1.0.
SignatureNonceStringYesA unique random number used to prevent replay attacks. Use a different random value for each request.

Business parameters

Field NameField typeRequiredDescriptionExampleDescription
actionStringRequiredAPI nameGenerateAliyunBidCertWaysUrlThe name of the API. Set this to GenerateAliyunBidCertWaysUrl.
AliyunPkStringRequiredUID of the Alibaba Cloud account123*******789The digital ID of the identity-verified Alibaba Cloud account
BidTypeStringRequiredReseller typeLIGHTWEIGHTThe reseller type. NORMAL: A standard reseller (default). LIGHTWEIGHT: A lightweight reseller.
PlatformStringRequiredThe platform type of the business.pcThree 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).
SubjectTypeStringRequiredVerification typeall 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).
SourceStringRequiredBusiness sourceBIDSet this to BID.
IsOpenAppBooleanRequiredSpecifies whether to wake up the Alipay app for quick verification. This is usually set to true on mobile clients.truetrue or false
IsMobileBooleanRequiredSpecifies whether the Alipay authorization page uses a mobile-friendly layout for quick verification. This is usually set to true on mobile clients.truetrue or false

Return values

FieldDescription
RequestIdThe request ID, used to track the request.
DataThe URL for identity verification. Display this URL in your reseller system.
SuccessIndicates whether the request was successful. A value of true indicates success. A value of false indicates failure.
CodeThe error code.
MessageThe 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

HttpCodeError codeError messageDescription
400Empty PKThe input parameter 'PK' mandatory for processing this request is not supplied.The PK cannot be empty.
403Not BidThe interface can not be called by a non-bid accountThe caller is not a reseller account.
403Bid MismatchPk 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.
404Invalid PKThe specified parameter 'PK' does not exist in our records.The account that corresponds to the specified PK does not exist.
400Already CertifiedAccount is already certifiedThis account is already verified. The existing information will not be overwritten.
404InvalidApi.NotFoundInvalidApi.NotFoundThe 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.
404InvalidAccessKeyId.NotFoundInvalidAccessKeyId.NotFoundThe specified AccessKeyId does not exist.
400SignatureNonceUsedSignatureNonceUsedThis 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.
400SignatureDoesNotMatchSignatureDoesNotMatchThe 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.