Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of Wechat authorizing the Interface to log in and obtain user Information

Shulou Source: shulou.com Published: 2022-06-03 16:20:27 11月14日 Update

This article mainly shows you the "example analysis of Wechat authorization login and access user information interface". The content is simple and clear. I hope it can help you solve your doubts. Next, let the editor lead you to study and learn the "sample analysis of Wechat authorization login and access user information interface".

Recently, we are doing the development of Wechat interface, so summarize the development process of this interface for Wechat to authorize login and obtain user information.

1. First of all, your official Wechat account needs to obtain the corresponding AppID and AppSecret, and after applying for Wechat login and passing the examination, you can start the access process.

II. Authorization process

1. Process description

(1)。 After a third party initiates a Wechat authorization login request, and after Wechat users are allowed to authorize a third-party application, Wechat will pull the application or redirect to the third-party website with the authorized temporary ticket code parameter

(2)。 Exchange for access_token through API through code parameters plus AppID and AppSecret

(3)。 Call the interface through access_token to obtain the user's basic data resources or help the user to achieve basic operations.

2. Get the access_token sequence diagram:

Third, development (I use the CI framework, in fact, any framework is the same, the MVC pattern is fine)

1. Request CODE

Weixin.php

Get the Controller code of code

Wxmodel.php

Tags: User information interface parameter cache page code ticket personal login can pass error data process third party example analysis content file log Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Technology MySQL NVidia Redmi