微信文档: 微信网页授权
pip install Flask-WX-OAuth
wx_oauth = WXOAuth()
wx_oauth.init_app(app)
配置 WX_APPID 和 WX_SECRET
next = request.args.get('next', '/')
redirect_uri = url_for('.authorized', next=next, _external=True)
params = dict(
redirect_uri=redirect_uri,
scope='snsapi_base',
)
return redirect(wx_oauth.get_authorize_url(**params))
docker build -t flask-wx-oauth .
docker run -p 5000:5000 flask-wx-oauth