WeChat official account - third-party webpage (H5) authorized login (OAuth2.0) process and logic detailed tutorial

foreword

When accessing third-party webpages in the WeChat client, the official account can obtain basic user information through the WeChat webpage authorization mechanism, and then implement business logic.

Regarding the authorization of the official account webpage,

Most of the online blog tutorials are illogical (scattered), to be precise, they are not written from the perspective of a novice.

This article will complete the authorization login of the front end from 0 to 1 from the perspective of Xiaobai , which is very detailed.

Preparation Phase

This address will be used in multiple places in the future (as a callback address).

First run your project through a local service to get Networkan accessible network.
insert image description here

1. Apply for a test public account

The test must have a service account and be certified, but using a company or personal online public account directly is not only unsafe, but also difficult to debug and test, so you need to apply for a test account.

You need to have an official account first and log in to the background. If you don't have it, ask the relevant personnel of the company for it.

Click on the public platform test account, as shown below:

Guess you like

Origin blog.csdn.net/weixin_44198965/article/details/123472756