当前位置:网站首页>[oauth2] VII. Wechat oauth2 authorized login
[oauth2] VII. Wechat oauth2 authorized login
2022-07-26 13:30:00 【Beicheng Xiaolin】
Preface
I've put gitee Of OAuth2 The authorized login process and configuration are clear , Simple theory is very boring , and gitee Of OAuth2 The compasses , There are not many things we need to customize . Therefore, this paper combines wechat web page development documents to realize web pages in wechat environment OAuth2 to grant authorization . Wechat web page authorization is for OAuth2 In some places of “ Bring in private goods ”, Non standard OAuth2, Many places need customization . This is not just a challenge , Or learn Spring Security OAuth2 A good material for , And the cool thing is that it provides sandbox .
this paper DEMO Branch :wechat Branch .
One 、 Environmental preparation
Before we start, we need to prepare the wechat web development environment .
1、 WeChat official account No.
Please note that , It must be wechat official account service number , Only the service number can provide such capability . Although the general official account is also a certified official account , However, it can only send articles and does not have the ability to provide services . However, wechat public platform provides sandbox function to simulate service number , Can reduce the difficulty of development , You can go to Wechat official account test account Page application , Don't forget to pay attention to the official account after successful application. .
The official wechat official account service number is only for enterprises and institutions 、 Only government organs can be opened , Wechat web development reference documents .
2、 Intranet through
Because the wechat server needs to callback the callback interface provided by the developer , To be able to debug locally , Intranet penetration tools are also necessary . After starting intranet penetration , You need to configure the virtual domain name provided by the intranet penetration tool into the callback configuration of wechat test account , Be sure to follow the figure below .
Configure callback address

Official account

Modify the web account to obtain the information domain name

Insert picture description here
Two 、 Code configuration
1、 The configuration file

2、 Custom configuration class

3、 Wechat development tool for login test

You can also directly enter the address in the upper address bar to log in
http://iqf667.natappfree.cc/oauth2/authorization/wechat
4、 After logging in successfully, we arrive at our default page

边栏推荐
- B+ tree index uses (7) matching column prefix, matching value range (19)
- Uncover the secret of white hat: 100 billion black products on the Internet scare musk away
- Sword finger offer (IX): abnormal jumping steps
- Win11+vs2019 configuration yolox
- 概率论与数理统计
- Win11+VS2019配置YOLOX
- Basic sentence structure of English ----- origin
- We were tossed all night by a Kong performance bug
- SuperMap iclient for leaflet loads Gauss Kruger projection three-dimensional zonation CGCS2000 geodetic coordinate system WMTs service
- 【花雕动手做】有趣好玩的音乐可视化系列小项目(13)---有机棒立柱灯
猜你喜欢

Ultimate doll 2.0 | cloud native delivery package

Concept and handling of exceptions

【Oauth2】五、OAuth2LoginAuthenticationFilter
![[upper computer tutorial] Application of integrated stepping motor and Delta PLC (as228t) under CANopen communication](/img/d4/c677de31f73a0e0a4b8b10b91e984a.png)
[upper computer tutorial] Application of integrated stepping motor and Delta PLC (as228t) under CANopen communication

This article explains the FS file module and path module in nodejs in detail

多线程使用不当导致的 OOM

AI-理论-知识图谱1-基础

Chat system based on webrtc and websocket

【黑马早报】字节旗下多款APP下架;三只松鼠脱氧剂泄露致孕妇误食;CBA公司向B站索赔4.06亿;马斯克否认与谷歌创始人妻子有婚外情...

Emotion analysis model based on Bert
随机推荐
Basic sentence structure of English ----- origin
【开源之美】nanomsg(2) :req/rep 模式
如何构建以客户为中心的产品蓝图:来自首席技术官的建议
Activity.onStop() 延迟10秒?精彩绝伦的排查历程
飞盘,2022年“黑红”顶流
LeetCode 263.丑数
云智技术论坛工业专场 明天见!
Sword finger offer (IX): abnormal jumping steps
pomerium
MVVM architecture encapsulation of kotlin series (kotlin+mvvm)
Solution 5g technology helps build smart Parks
The child component triggers the defineemits of the parent component: the child component passes values to the parent component
Exploration on cache design optimization of community like business
【花雕动手做】有趣好玩的音乐可视化系列小项目(13)---有机棒立柱灯
12 brand management of commodity system in gulimall background management
The use of asynchronous thread pool in development
B+ tree (4) joint index -- MySQL from entry to proficiency (16)
flutter多渠道打包运行
Dimension disaster dimension disaster suspense
One stroke problem (Chinese postman problem)