Personal website WeChat login solution

background

As a website developer, if the website can use WeChat to log in, it will undoubtedly provide users with great convenience, and our website can also get traffic relatively easily.

However, the WeChat authorized login function is only provided to certified enterprise users. Individual developers cannot use this function, which causes great inconvenience to individual developers.

So as individual developers, can’t we give our system the WeChat login function? In fact, individual developers can also use the WeChat login function. Here is a solution.

Yideng - empowering individual developers to log in with WeChat

Yideng is a website that provides WeChat code scanning login services for individual developers. It only takes a few simple steps to enable WeChat login for individual developer websites.
For detailed instructions, refer to the document: https://www.jylt.cc/#/detail?id=f834fb3656cf84113db6eaa7952ed970 .

Here are detailed usage tutorials and usage scenarios. Friends in need are welcome to experience.

Eden- Principle of Realization

Since we cannot directly use the WeChat login function, we have no choice but to adopt a curve to save the country.

We all know that the function of WeChat mini programs to obtain user information has no restrictions on individual developers. Since mini programs can obtain user information, we can also obtain user information through mini programs on the website.

First, developers need to create a secret for the website in Yiden , and bind the secret to a service interface that Yiden can request. After configuring these contents in Yiden , it is the developer's job to connect the interface.

The user requests Yiden to obtain the WeChat login QR code interface on the front end of the website. The QR code image address and the temporary identity certificate of the currently logged-in user are displayed through the QR code image address responded to by the interface . Then the user scans the QR code to log in through WeChat. After the user confirms the authorized login, the Yiden service will request the callback interface filled in by the developer in Yiden. The request parameters initiated by Yiden are some basic information of the user, such as openid, avatar, nickname, etc. , after the interface filled in by the developer receives the request, it can use the user information according to its own business needs. Then after the developer obtains these user information, it will respond to Yideng with a successful status code. This is the end of the entire login process, and the mini program will prompt the user to log in successfully.

Scanning experience

Developers can first go to Yideng and remember the journey to scan the QR code to log in.
An example image is as follows:
sample graph

Guess you like

Origin blog.csdn.net/wuchenxiwalter/article/details/124655027