HADB / Getweixincode
Licence: mit
解决微信OAuth2.0网页授权只能设置一个回调域名的问题
Projects that are alternatives of or similar to Getweixincode
Weixin Java Mp Demo基于Spring Boot 和 WxJava 实现的微信公众号Java后端Demo,支持多公众号
Stars: ✭ 1,291 (-5.9%)
Mutual labels: wechat
Gxgk Wechat Server校园微信公众号,使用 Python、Flask、Redis、MySQL、Celery [DEPRECATED]
Stars: ✭ 1,325 (-3.43%)
Mutual labels: wechat
Phps.shop Api如花拼团商城_TP5_VUE_小程序
Stars: ✭ 90 (-93.44%)
Mutual labels: wechat
Wx VoiceConvert audio files between Tencent apps (Weixin / Wechat, QQ) and Silk codec with other general formats such as MP3 and M4A
Stars: ✭ 93 (-93.22%)
Mutual labels: wechat
NeucharSenparc.NeuChar 跨平台信息交互标准
Stars: ✭ 96 (-93%)
Mutual labels: wechat
WechatdemomacOS WeChat 仿微信MAC端 QQ NSCollectionView,NSSplitView,ect..
Stars: ✭ 87 (-93.66%)
Mutual labels: wechat
Examiner操作系统通知中心监控(不论微信、钉钉、QQ,只要开启消息通知),可编写对应处理脚本
Stars: ✭ 100 (-92.71%)
Mutual labels: wechat
Wxmlify一个轻量快速的插件,帮助你在微信小程序中显示富文本编辑器生成的HTML。
Stars: ✭ 93 (-93.22%)
Mutual labels: wechat
Wechat Mall清欢美味食光机,也是我做的第一个小程序,功能比较简单,后台基于API工厂
Stars: ✭ 98 (-92.86%)
Mutual labels: wechat
Ifwechatlink wechat to ifttt
Stars: ✭ 90 (-93.44%)
Mutual labels: wechat
Tina Hackernews📺 A Tina.js powered Wechat-Mini-Program implementation of Hacker News Reader
Stars: ✭ 93 (-93.22%)
Mutual labels: wechat
TeepayTypecho 个人支付宝、微信收款插件
Stars: ✭ 90 (-93.44%)
Mutual labels: wechat
Weapp Qrcode Base64微信小程序生成二维码的插件,基于base64编码输出二维码,不依赖canvas
Stars: ✭ 100 (-92.71%)
Mutual labels: wechat
Easywechat📦 一个 PHP 微信 SDK
Stars: ✭ 9,676 (+605.25%)
Mutual labels: wechat
Flutterwechatflutter版高仿微信7.0
Stars: ✭ 98 (-92.86%)
Mutual labels: wechat
GetWeixinCode
解决微信OAuth2.0网页授权只能设置一个回调域名的问题
UPDATE
最近发现微信公众号的网页授权域名已经支持配置多个,目前该项目的存在意义没有之前强烈了。目前唯一的用处就是多个域名可以统一在一个地方处理。
使用方法
-
部署get-weixin-code.html
至你的微信授权回调域名的目录下
-
使用方式类似于直接通过微信回调的方式,只是将回调地址改成了get-weixin-code.html
所在的地址,另外省去了response_type
参数(因为它只能为code
)以及#wechat_redirect
(它是固定的),它们会在get-weixin-code.html
里面自己加上
-
get-weixin-code.html
页面从微信那里拿到code之后会重新跳转回redirect_uri
里面填写的url,并且在url后面带上code
和state
详细示例
-
前往微信公众平台->接口权限->网页授权获取用户基本信息->修改,填写授权回调页面域名,例如www.abc.com
-
在www.abc.com
域名下部署get-weixin-code.html
,不一定是根目录,例如:http://www.abc.com/xxx/get-weixin-code.html
-
假设你的http://www.xyz.com/hello-world.html
这个页面需要获取微信授权,那么你应该使用以下地址来获取授权:http://www.abc.com/xxx/get-weixin-code.html?appid=XXXX&scope=snsapi_base&state=hello-world&redirect_uri=http%3A%2F%2Fwww.xyz.com%2Fhello-world.html
-
这样最终就会跳转到这样一个地址:http://www.xyz.com/hello-world.html?code=XXXXXXXXXXXXXXXXX&state=hello-world
,从而你就拿到了授权code
以及自定义的state
参数了
Star走势图
特别感谢
感谢以下朋友为本项目提供的贡献(排名不分先后)
其他说明
-
通过多一次的跳转,解决了微信限制回调域名只能设置一个的问题
-
牺牲了一点用户体验,换来了项目部署的美感,不需要将各种项目都部署到一个域名下
-
如果你有这样的需求,可以使用本项目
-
欢迎提交pull request
-
建议先弄懂微信授权回调的流程再使用本项目
-
很多朋友问我怎么支持第三方微信平台,这个需要对不同的第三方平台的授权方式有所了解,熟悉他们的授权方式,请求参数等。如果他们是通过在网站入口处的URL上进行授权的,那么可以使用本项目,将入口的URL改成上述的方式,如果他们是在流程中的某些页面去获取授权,那么是没法改变他们的获取地址的,所以本项目就不适用了
支持作者
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at
[email protected].