Considerations for accessing sesame credit in PHP, zhima credit
The official download SDK from zhima cannot run, and Baidu does not find many articles. Only one article written by a CSDN blog is of reference value.
For more information, see the document + several days to test and sort out the following considerations:
To access the sesame API, perform the following two steps:
Step 1: get authorization. This is the official SDK. You can perform operations only if the parameter configuration is correct. Note the following parameters,
In addition, the most important point is the generation and modification of the sesame public key. The generated public key is copied to the sesame background according to official operations. After saving the public key, sesame will generate a new public key and click Copy, save it to our public key file and upload it to the space for PHP call.
$ Request-> setScene ("test ");
$ Request-> setChannel ("apppc ");
$ Request-> setPlatform ("zmop ");
$ Request-> setIdentityType ("2"); // required Parameter
// Construct an Authorization Service input credential number, name, and credential type. "business input parameter description in Section 4: identity_param"
$ Request-> setIdentityParam ("{\" certNo \ ": \" $ certNo \ ", \" certType \ ": \" IDENTITY_CARD \ ", \" name \": \ "$ name \"}");
// $ Request-> setIdentityParam ("{\" certNo \ ": \" $ certNo \ ", \" certType \ ": \" IDENTITY_CARD \", \ "name \": \ "$ name \", \ "mobileNo \": \ "$ mobile \"}");
// Construct the business input parameter extension parameter "biz_params" in Section 4"
$ Request-> setBizParams ("{\" auth_code \ ": \" M_H5 \ ", \" channelType \ ": \" app \ ", \" state \": \ "$ uid \"}");//
After successful authorization, the system will jump to the callback address we set. This callback address is the GET parameter and has a param parameter. You must use the decryption function in the SDK to obtain the client's OPENI_ID after decryption,
After obtaining the OPEN_ID, save it to the database and complete the authorization.
Step 2,
According to the OPEN_ID obtained by the authorization, the zhima score is obtained. The example in this SDK can be run...
The most important thing is the first point.