Home >Backend Development >PHP Tutorial >PHP Sesame Credit Access Precautions_php Example
The SDK officially downloaded from Sesame cannot run. A search on Baidu did not find many articles. There was only one article written by a CSDN blog, which is of more reference value
Read the documentation in detail + test for a few days to sort out the following points:
Connecting to the Sesame API interface should be divided into two steps:
The first step is to obtain authorization. This is the official SDK. As long as the parameters are configured correctly, it can be operated. Pay attention to the following parameters, compare with Sesame document,
The other most important point is, Sesame public key generation and modification, the generated public key is copied into the Sesame backend according to the official operation. After saving, Sesame will generate a new public key, click copy, and save it to us The public key file is then uploaded to the space for PHP to call.
$request->setScene("test"); $request->setChannel("apppc"); $request->setPlatform("zmop"); $request->setIdentityType("2");// 必要参数 // 构造授权业务入参证件号,姓名,证件类型;“章节4中的业务入参说明identity_param” $request->setIdentityParam("{\"certNo\":\"$certNo\",\"certType\":\"IDENTITY_CARD\", \"name\":\"$name\"}"); // $request->setIdentityParam("{\"certNo\":\"$certNo\",\"certType\":\"IDENTITY_CARD\", \"name\":\"$name\",\"mobileNo\":\"$mobile\"}"); // 构造业务入参扩展参数“章节4中的业务入参说明biz_params” $request->setBizParams("{\"auth_code\":\"M_H5\",\"channelType\":\"app\",\"state\":\"$uid\"}");//
After the authorization is successful, it will jump to the callback address we set. This callback address GET parameter has a param parameter. The decryption function in the SDK must be used. After decryption, the customer's OPENI_ID can be obtained,
Okay, after getting this OPEN_ID, save it to the database, and the authorization is completed.
The second step,
According to the OPEN_ID obtained through authorization, you will get points. The example in this SDK can be run. . .
The most important thing is the first point.
The above are the precautions for PHP Sesame Credit access introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank you all for your support of the Script House website!