PHP Sesame Credit Access Considerations _php Instance

Source: Internet
Author: User

Chimaguan side of the SDK download, run not up, Baidu search some also did not find too many articles, only a CSDN blog wrote an article, more reference value

Consult the documentation in more detail for a few days. The following considerations are sorted out:

Access to the Sesame API interface, should be divided into 2 steps:

The first step, get the authorization, this, the official SDK, as long as the parameters are configured correctly, you can operate. Note the following parameters, compared to the sesame document,

In addition, the most important point,,, sesame public key generation, as well as modified, generated public key in accordance with official operations copied into the sesame background, after saving, sesame will generate a new public key, click Copy, save to our public key file, and then upload to the space to the PHP call.

$request->setscene ("test"); 
$request->setchannel ("APPPC");
$request->setplatform ("Zmop");
$request->setidentitytype ("2")//Necessary parameters 
//structuring Authorized Business Entry identification number, name, certificate type; The business parameters in Chapter 4 describe Identity_param " 
$request->setidentityparam (" {\ certno\ ": \" $certNo \ ", \" certtype\ ": \" Identity_ Card\ ", \" name\ ": \" $name \ "}"); 
$request->setidentityparam ("{\" certno\ ": \" $certNo \ "," certtype\ ": \" identity_card\ ", \" name\ ": \" $name \ ", \" Mobileno\ ": \" $mobile \ "}"); 
Construct business parameter extension parameters "business entry parameter description in Chapter 4 Biz_params" 
$request->setbizparams ("{\ auth_code\": \ "m_h5\", \ "channeltype\": \ " App\ ", \" state\ ": \" $uid \ "}");

After the authorization succeeds, will jump to our set callback address, this callback address get parameter, has a param parameter, must use the decryption function in the SDK, after decrypting, can obtain the customer openi_id,

All right, after you get this open_id, save it to the database, and the authorization is complete.

Second step,

According to the authorized open_id, get sesame points, this SDK in the example, can run up ...

The most important thing is the 1th.

The above is a small set to introduce the PHP sesame Credit access to the attention, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.