Spring Boot 开发组件(git 父模块)
- 支持 OAuth 2.1 JWT 授权的支付宝小程序开发组件
- 支持 OAuth 2.1 JWT 授权的支付宝开放平台开发组件
- 支持 OAuth 2.1 JWT 授权的钉钉dingtalk开发组件
- 支持 OAuth 2.1 JWT 授权的飞书平台网页应用开发组件
- 支持 OAuth 2.1 JWT 授权的码云gitee开发组件
- 支持 OAuth 2.1 JWT 授权的github开发组件
- 支持 OAuth 2.1 JWT 授权的gitlab开发组件
- 支持 OAuth 2.1 JWT 授权的QQ开放平台开发组件
- 支持 OAuth 2.1 JWT 授权的QQ小程序平台开发组件
- 支持 OAuth 2.1 JWT 授权的微信小程序开发组件
- 支持 OAuth 2.1 JWT 授权的微信公众平台开发组件
- 支持 OAuth 2.1 JWT 授权的微信开放平台开发组件
- 支持 OAuth 2.1 JWT 授权的企业微信平台开发组件
- 支持 OAuth 2.1 JWT 授权的微博weibo平台开发组件
- 将以上 OAuth 2.1 组件打包成一个 jar 包
- 一个基于 Spring Boot Redis 的幂等组件
- Redis 序列化/反序列化 组件
- Spring Authorization Server OAuth 2.1 基于 Redis 的实现开发组件
- 2021年2月26日 发布第一个 spring-boot-starter-idempotent 版本,使用独立的Git仓库
- 2022年7月14日 发布第一个 spring-boot-starter-wechat-miniprogram 版本,使用独立的Git仓库
- 后来创建了几个其他与 spring-boot-starter-wechat-miniprogram 相同的项目类型,用于拓展 OAuth2.1 的授权,并且也使用了独立仓库。
- 为了统一管理、将所学应用于实践,所以创建了这个Git模块的父项目。
为何不将拓展 OAuth2.1 的授权登录合并成一个项目,提取公共部分减少冗余代码?
- 拓展 OAuth2.1 的授权的项目,起初只是为了拓展 OAuth2.1 的登录而拓展,没想到会做这么多种
- 考虑到后期可能会将除了登录意外的其他接口一并做了,放在一个项目中过于臃肿
- 虽然各厂商(微信、QQ、微博、码云、GitLab等)大都使用的都是 OAuth 2.0 的协议,但差别较大,比如:
- 返回数据的
Content-Type
应该为application/json
,而微信使用了text/html
- 网站类型与小程序类型授权方式与流程天然不同,无法轻易整合
- QQ扫码登录返回数据格式虽然可以设置为
JSON
,但是当参数有问题时,返回数据就不是JSON
了
- 微信返回
access_token
时携带用户唯一标识openid
、unionid
(绑定了开放平台后返回unionid
);QQ使用三个接口完了获取access_token
、openid
、unionid
;码云返回access_token
时无用户唯一标识,需要使用access_token
来获取用户唯一标识
- 微信等应用的客户唯一标识使用的是
appid
,码云等应用使用的是client_id
- 有些厂商获取
access_token
时需要redirect_uri
,有些厂商不需要
- 考虑到使用者可能会使用 GitLab 或自建
GitLab
,针对于 GitLab
授权,需要自定义域名
- 每种授权使用独立的
jar
包,使用者上手方便,学习成本低,容易排查问题(宁愿开发者自己麻烦,不想提高使用者的成本)
- 拓展 OAuth2.1 的授权的项目维护虽然复杂了,但是像这种第三方授权流程,一旦做完了,万年不变(除了更新一下 OAuth 2.1 的依赖而已)
- 考虑新增组件 spring-boot-starter-oauth2,将 OAuth 2.1 组件打包成一个 jar 包,方便引用
git submodule add -b main ../spring-boot-starter-alipay-miniprogram.git spring-boot-starter-alipay-miniprogram
git submodule add -b main ../spring-boot-starter-alipay-oplatform.git spring-boot-starter-alipay-oplatform
git submodule add -b main ../spring-boot-starter-dingtalk.git spring-boot-starter-dingtalk
git submodule add -b main ../spring-boot-starter-feishu-webpage.git spring-boot-starter-feishu-webpage
git submodule add -b main ../spring-boot-starter-gitee.git spring-boot-starter-gitee
git submodule add -b main ../spring-boot-starter-github.git spring-boot-starter-github
git submodule add -b main ../spring-boot-starter-gitlab.git spring-boot-starter-gitlab
git submodule add -b main ../spring-boot-starter-qq-connect.git spring-boot-starter-qq-connect
git submodule add -b main ../spring-boot-starter-qq-miniprogram.git spring-boot-starter-qq-miniprogram
git submodule add -b main ../spring-boot-starter-wechat-miniprogram.git spring-boot-starter-wechat-miniprogram
git submodule add -b main ../spring-boot-starter-wechat-offiaccount.git spring-boot-starter-wechat-offiaccount
git submodule add -b main ../spring-boot-starter-wechat-oplatform.git spring-boot-starter-wechat-oplatform
git submodule add -b main ../spring-boot-starter-wechat-work.git spring-boot-starter-wechat-work
git submodule add -b main ../spring-boot-starter-weibo.git spring-boot-starter-weibo
git submodule add -b main ../spring-boot-starter-idempotent.git spring-boot-starter-idempotent
git submodule add -b main ../spring-boot-starter-redis.git spring-boot-starter-redis
git submodule add -b main ../spring-security-oauth2-authorization-server-redis.git spring-security-oauth2-authorization-server-redis
git clone https://gitee.com/xuxiaowei-com-cn/spring-boot-starter.git --recursive
git clone https://gitee.com/xuxiaowei-com-cn/spring-boot-starter.git
cd spring-boot-starter
git submodule
git submodule init
git submodule update
git submodule update
git submodule update --remote
git submodule foreach git checkout main
git submodule foreach git checkout next
将 origin 远程 URL 修改为 github 远程 URL
git remote set-url origin $(git remote get-url github)
将所有子模块的 origin 远程 URL 修改为 github 远程 URL
# Windows 需要使用 git bash
git submodule foreach 'git remote set-url origin $(git remote get-url github)'
点击展开
git remote add gitee https://gitee.com/xuxiaowei-com-cn/spring-boot-starter.git
git remote add gitlab https://gitlab.com/xuxiaowei-com-cn/spring-boot-starter.git
git remote add framagit https://framagit.org/xuxiaowei-com-cn/spring-boot-starter.git
git remote add github https://github.com/xuxiaowei-com-cn/spring-boot-starter.git
git remote add gitcode https://gitcode.net/xuxiaowei-com-cn/spring-boot-starter.git
git remote add gitlink https://gitlink.org.cn/xuxiaowei-com-cn/spring-boot-starter.git
git submodule foreach 'git remote add gitee https://gitee.com/xuxiaowei-com-cn/$(basename $path).git'
git submodule foreach 'git remote add gitlab https://gitlab.com/xuxiaowei-com-cn/$(basename $path).git'
git submodule foreach 'git remote add framagit https://framagit.org/xuxiaowei-com-cn/$(basename $path).git'
git submodule foreach 'git remote add github https://github.com/xuxiaowei-com-cn/$(basename $path).git'
git submodule foreach 'git remote add gitcode https://gitcode.net/xuxiaowei-com-cn/$(basename $path).git'
git submodule foreach 'git remote add gitlink https://gitlink.org.cn/xuxiaowei-com-cn/$(basename $path).git'
点击展开
git fetch "origin" next:next
git fetch "origin" main:main
cd spring-boot-starter-alipay-miniprogram
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-alipay-oplatform
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-dingtalk
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-feishu-webpage
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-gitee
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-github
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-gitlab
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-qq-connect
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-qq-miniprogram
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-wechat-miniprogram
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-wechat-offiaccount
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-wechat-oplatform
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-wechat-work
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-weibo
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-idempotent
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-boot-starter-redis
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "origin"
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
cd spring-security-oauth2-authorization-server-redis
git fetch "origin" next:next
git fetch "origin" main:main
git.exe push --all --progress "origin"
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"
cd ..
git.exe push --all --progress "origin"
git.exe push --all --progress "gitee"
git.exe push --all --progress "gitlab"
git.exe push --all --progress "framagit"
git.exe push --all --progress "github"
git.exe push --all --progress "gitcode"
git.exe push --all --progress "gitlink"