Example 1. configure the domain name of the authorization callback page, such as www.aaa.com? 2. a third-party webpage simulating a public account, fn_system.php & lt ;? Phpif (empty ($ _ SESSION ['user']) {header (OAuth2.0 web page authorization php example
1. configure the authorization callback page domain name, such as www.aaa.com
?
2. a third-party webpage simulating a public account, fn_system.php
?
3. when accessing a third-party webpage, if the session information does not exist in the session, go to the login page, fn_wx_login.php
?
4. on the login page, assemble the appid, jump back url, and other information, and then jump to the user authorization page.
?
5. on the user authorization page, if you select "agree to authorize", The code parameter is included when you jump back to the redirection address of a third-party webpage.
?
6. in the redirection url of a third-party webpage, first obtain the code from the request, and then exchange openid and access_token based on the code, then, you can query User information based on the APIs called by openid and access_token.
?