Home > Article > WeChat Applet > Detailed explanation of WeChat mini program login process
This article mainly explains in detail the relevant information about the WeChat Mini Program login process. Friends who need it can refer to
WeChat Mini Program Login Process
##1 :What are session_key and openId? session_key
The official description is: service server to encrypt and sign user data
interface. (2) "Process it slightly" and use it to maintain the login state of the applet.
(2) Treat this random number as The key of session, session_key + openid is value.
https:// api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code
Getting steps: (2) Replace the APPID, SECRET, and JSCODE of the above interface address with appid, secret, and js_code respectively. Leave the others unchanged and assemble them into a complete address.
3: In "Open this address in the browser" or "Simulate the browser in the background" GET executes this address" to return the following JSONdata (including openid, sessionkey)
WeChat applet obtains session_key and openId (encryption, decryption, signature series)
4: Obtain appid and secret
union.com/forum.php?mod=viewthread&tid=495
5: How to obtain js_code by calling the wx.login() interface to obtain the login credentials (js_code)
WeChat applet obtains session_key and openId (encryption, decryption, signature series)6: Summarize the entire session_key acquisition process
(1) Register for the WeChat applet, log in to the background and obtain the appId and secret in the settings (Key)(2) Call the wx.login() interface to obtain the login credentials js_code
(3) Call the wx.request() interface to send the js_code to the server background
(4) In the server background, Known appId, secret, js_code
The above is the detailed content of Detailed explanation of WeChat mini program login process. For more information, please follow other related articles on the PHP Chinese website!