Article Directory
1. How to realize WeChat scan code login?
The overall process of this model is:
- The third party initiates a WeChat authorization login request. After the WeChat user allows the third-party application to be authorized, WeChat will launch the application or redirect to the third-party website, and bring the authorization temporary ticket code parameter;
- Add AppID and AppSecret through the code parameter and exchange for access_token through API;
- Use access_token to call the interface to obtain basic user data resources or help users achieve basic operations.
Get access_token sequence diagram:
2. Official account settings
Note: The official account of personal authentication does not have the authority of the webpage to obtain basic information of WeChat users
Three, configure MP_verify_lgErIaiJeOtfLiru.txt
# coding=gbk
from fastapi import FastAPI
from starlette.staticfiles import StaticFiles
app = FastAPI()
app.mount("/", StaticFiles(directory="./app/static"), name="static")
Fourth, get the developer password
To obtain AppSecret, you need to register for WeChat scan code, and then enter the official account login password.