With the rise of WeChat on mobile phones, Tencent's WeChat Union Login is indeed very tempting for PC-side partners. Now let's talk about the way to use WeChat to scan on the PC side to realize WeChat's third-party login.
Step 1: Obtain AppID AppSecret (no explanation, go to WeChat public platform to apply)
Step 2: Generate and scan QR code to obtain code
https://open.weixin.qq.com/connect/qrconnect?appid=AppID&redirect_uri =http://www.baidu.com&response_type=code&scope=snsapi_login&state=2014#wechat_redirect
Step 3: Get access_token through code
https://api.weixin.qq.com/sns/oauth2/access_token?appid=AppID&secret=AppSecret &code =00294221aeb06261d5966&grant_type=authorization_code
Step 4: Due to the frequency limit of the interface, if necessary, refresh the access_token
https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=AppID&grant_type=refresh_token&refresh_token=REFRESH_TOKEN
Step 5: Pass access_token and openid obtain basic user information, including avatar, nickname, gender, region
https://api.weixin.qq.com/sns/userinfo?access_token=bezXEiiBSKSxW0eoblIewFNHqAG-PyW9OqI_L81E4ZCi2cFpfoJTyQc0xKlPPCtqK1kLJfiRbVrpoOVLw7fjpqh52bn7C68SHa2HSgYsVPXZPvJvtayDa57-_7TeHYw&openid=o39YsbmuV_bIPGpj1MTe
This is the online interface to debugging tools:
http://mp.weixin.qq.com/debug/
This is the error code Documentation:
http://mp.weixin.qq.com/wiki/17/fa4e1434e57290788bde25603fa2fcbd.html
In addition, special attention should be paid if the developer has multiple official accounts, or unified user accounts between official accounts and mobile applications. To meet the above requirements, you need to go to the WeChat open platform (open.weixin.qq.com) to bind the official account, and then use the UnionID mechanism to meet the above requirements. Document:
http://mp.weixin.qq.com/wiki/14/ bb5031008f1494a59c6f71fa0f319c66.html
WeChat third-party login interface
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=326581299&siteId=291194637
Recommended
Ranking