Compare commits

...

651 Commits

Author SHA1 Message Date
yadong.zhang
694bbf1b01 📝 编写文档 2024-12-14 17:32:48 +08:00
yadong.zhang
bbf63c6056 Merge branch 'dev' 2024-12-14 17:14:04 +08:00
yadong.zhang
44d77f3d6a Merge branch 'dev' of github.com:justauth/JustAuth into dev 2024-12-14 17:13:06 +08:00
yadong.zhang
2b6e419943 📝 编写文档 2024-12-14 17:12:00 +08:00
yadong.zhang
56bfe2803a
Merge pull request #223 from hurentian/dev
feat: 支持QQ小程序
2024-12-14 17:09:49 +08:00
yadong.zhang
89d107f6da
Merge pull request #222 from Yeaury/fix-doc-link
fix: Fix documentation link in README
2024-12-14 17:07:21 +08:00
yadong.zhang
cdcf9a5e8d 🔥 支持支付宝证书模式登录 2024-12-14 17:02:33 +08:00
yadong.zhang
354f00660b 💩 AppleId 登录的 POM 依赖改为 provided 2024-12-14 14:31:50 +08:00
hurentian
4b07aecfcf feat: 支持QQ小程序 2024-10-17 09:52:33 +08:00
31445
9862f487b4 fix: correct documentation link in README 2024-10-13 11:57:27 +08:00
yadong.zhang
9153e97398 merge pr 2024-09-02 00:45:40 +08:00
yadong.zhang
64e1098519 💩 添加新版钉钉扫码登录能力 2024-09-02 00:24:05 +08:00
yadong.zhang
e9135436f9 💩 修复企业微信扫码登录 code 的传值 2024-09-01 18:19:05 +08:00
yadong.zhang
20731ea77e 💩 添加新版华为登录能力,原AuthHuaweiRequest会在后面版本被弃用,如有使用,请切换到AuthHuaweiV3Request 2024-09-01 18:15:18 +08:00
yadong.zhang
587d2f4072
!42 修改爱发电平台的域名为https://afdian.com
Merge pull request !42 from handy/handy-0827
2024-08-27 03:44:47 +00:00
handy
602a48b3ce 修改爱发电平台的域名为https://afdian.com 2024-08-27 10:51:00 +08:00
yadong.zhang
91167bcbf7 🔥 支持微信小程序 2024-08-17 20:16:14 +08:00
yadong.zhang
8f376129d4 🔥 支持微信小程序 2024-08-17 20:11:51 +08:00
yadong.zhang
6859b8a949 🔥 Amazon PKCE 中的 code_verifier 基于 state 缓存 2024-08-04 23:28:55 +08:00
yadong.zhang
b01704ff78 💩 解决单测失败的问题 2024-08-04 15:51:38 +08:00
yadong.zhang
0731ebd130 Merge remote-tracking branch 'origin/dev' into dev 2024-08-04 15:38:56 +08:00
yadong.zhang
5eb8160a42 💩 添加新版企业微信扫码登录能力(PS. 新版企业微信登录,除了支持使用移动端企业微信扫码登录之外,还支持通过企业微信桌面端进行快速登录。) 2024-08-04 15:38:40 +08:00
yadong.zhang
415c703539 💩 修复 twitter 平台在 Java11 环境下登录失败的问题。[#174](https://github.com/justauth/JustAuth/issues/174) 2024-08-04 15:33:49 +08:00
yadong.zhang
5d521e3ea4 💩 添加新版企业微信扫码登录能力(PS. 新版企业微信登录,除了支持使用移动端企业微信扫码登录之外,还支持通过企业微信桌面端进行快速登录。) 2024-08-04 15:33:37 +08:00
yadong.zhang
0eafb96a43 💩 improve: 优化 AuthCallback 获取 code 的方式 2024-08-04 14:45:30 +08:00
yadong.zhang
6d8b3b5f1d 💩 getAccessTokengetUserInfo两个方法从AuthDefaultRequest提升至AuthRequest中,方便直接使用。[Github Issue#194](https://github.com/justauth/JustAuth/issues/194) 2024-08-03 18:27:36 +08:00
yadong.zhang
15b1a974f3 💩 补全抖音平台缺失字段补全。Github#188 2024-08-03 17:57:41 +08:00
yadong.zhang
74b5b4b3bc Merge branch 'dev' of github.com:justauth/JustAuth into dev
g the commit.
2024-08-03 16:35:53 +08:00
yadong.zhang
6cc414997d Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	src/main/java/me/zhyd/oauth/config/AuthDefaultSource.java
2024-08-03 16:34:13 +08:00
yadong.zhang
7c6f236733 Merge branch 'master' of github.com:justauth/JustAuth 2024-08-03 16:31:02 +08:00
yadong.zhang
bf5a6d1b17 Merge branch 'master' of github.com:justauth/JustAuth into dev 2024-08-03 16:29:12 +08:00
yadong.zhang
9db9fbdcc8
Merge pull request #211 from justauth/dependabot/maven/org.bouncycastle-bcpkix-jdk18on-1.78
⬆️ Bump org.bouncycastle:bcpkix-jdk18on from 1.77 to 1.78
2024-08-03 16:28:39 +08:00
yadong.zhang
0acd67e704 ⬆️ 切分 v1.16.7 版本 2024-08-03 12:15:03 +08:00
dependabot[bot]
992f4a67ac
⬆️ Bump org.bouncycastle:bcpkix-jdk18on from 1.77 to 1.78
Bumps [org.bouncycastle:bcpkix-jdk18on](https://github.com/bcgit/bc-java) from 1.77 to 1.78.
- [Changelog](https://github.com/bcgit/bc-java/blob/main/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

---
updated-dependencies:
- dependency-name: org.bouncycastle:bcpkix-jdk18on
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-03 04:08:01 +00:00
yadong.zhang
2ee2483aee
Merge pull request #192 from G-XD/feat_apple
feat: sign with apple
2024-08-03 12:07:24 +08:00
yadong.zhang
a1c1ab93bd
!41 集成Figma平台
Merge pull request !41 from xiangqian/fork
2024-07-22 15:27:26 +00:00
xiangqian
eaafd49890 feat: 集成figma平台 2024-07-22 21:40:07 +08:00
yadong.zhang
74be7d4c8b
Merge pull request #198 from GitHubzhaolei/master
change:变更Google 端点地址
2024-06-23 23:06:03 +08:00
“zhaolei”
d62bb6eecf change:[google oauth] api addr 2024-03-14 16:53:02 +08:00
yadong.zhang
b2b007aa4d
!39 补充单侧
Merge pull request !39 from handy/dev
2024-03-02 04:20:16 +00:00
handy
431adb447f 补充单侧 2024-02-02 10:12:21 +08:00
yadong.zhang
78a318e799
!38 AuthRequest 响应携带泛型,避免二次解析
Merge pull request !38 from handy/handy
2024-02-01 15:42:17 +00:00
G-XD
988d3cd293 fix: fix user info 2024-01-19 11:49:35 +08:00
G-XD
72e4a1d846 feat: support sign with apple 2024-01-19 01:42:31 +08:00
handy
65bb994012 AuthRequest 响应携带泛型,避免二次解析 2024-01-04 12:51:50 +08:00
yadong.zhang
6b758e0e1e 💡 修改注释 2023-12-03 21:50:50 +08:00
yadong.zhang
02bd057963 🔀 合并 PR#166 2023-12-03 21:05:53 +08:00
yadong.zhang
4d2a110fea
Merge pull request #166 from christxlx/master
fix: bug 58-63 scope在微软最新的文档中要求必须用空格隔开,form构建时候空格会被强制转换为%20,所以此处重新覆盖
2023-12-03 21:04:10 +08:00
yadong.zhang
2ef8298278 Merge branch 'master' into dev 2023-12-03 21:01:16 +08:00
yadong.zhang
80ce57bce4 📝 编写文档 2023-12-03 21:00:45 +08:00
yadong.zhang
2fed3e5ba2 💩 修改 facebook 平台的 scope 2023-12-03 20:58:49 +08:00
yadong.zhang
1d38ce2835 💩 微软平台适配 AzureAD(目前改名为 Microsoft Entra ID)登录认证 2023-12-03 20:18:39 +08:00
yadong.zhang
14dd2b6179 💩 修复微信公众平台 scope 为 snsapi_base 登录报错的问题 [181](https://github.com/justauth/JustAuth/issues/181) 2023-12-03 20:17:47 +08:00
yadong.zhang
d6ba3bba10 💩 修复 twitter 平台在 Java11 环境下登录失败的问题。[#174](https://github.com/justauth/JustAuth/issues/174) 2023-12-03 16:55:55 +08:00
yadong.zhang
fe328c7375 💩 调整单元测试 2023-08-06 18:17:53 +08:00
yadong.zhang
102521a979 Merge branch 'dev' 2023-08-06 18:15:11 +08:00
yadong.zhang
924f0f552b 🔥 更新脚本 2023-08-06 18:14:42 +08:00
yadong.zhang
7167a74af2 💩 调整单元测试 2023-08-06 18:14:04 +08:00
yadong.zhang
c0ac81df08 Merge remote-tracking branch 'origin/master' 2023-08-06 18:10:09 +08:00
yadong.zhang
56cdd20600 Merge branch 'master' of gitee.com:yadong.zhang/JustAuth into dev 2023-08-06 18:07:45 +08:00
yadong.zhang
87d8c1d164 Merge branch 'master' into dev 2023-08-06 17:58:24 +08:00
yadong.zhang
d1f820514f ⬆️ 1.16.6 2023-08-06 17:57:47 +08:00
yadong.zhang
6d192e94ac Merge branch 'dev' of gitee.com:yadong.zhang/JustAuth into dev 2023-08-06 17:50:07 +08:00
yadong.zhang
02bec576de Merge branch 'dev'
# Conflicts:
#	README.md
2023-04-11 22:48:07 +08:00
yadong.zhang
0d599d75f0 替换 justauth.wiki 域名,该域名暂时不可用,请使用 justauth.cn 2023-04-11 22:46:53 +08:00
yadong.zhang
5171fb8148 替换 justauth.wiki 域名,该域名暂时不可用,请使用 justauth.cn 2023-04-11 22:45:58 +08:00
yadong.zhang
0025748ba7 替换 justauth.wiki 域名,该域名暂时不可用,请使用 justauth.cn 2023-04-11 22:42:47 +08:00
yadong.zhang
87cf45b675 替换 justauth.wiki 域名,该域名暂时不可用,请使用 justauth.cn 2023-04-11 22:41:18 +08:00
yadong.zhang
bd1192f17f Merge branch 'dev'
# Conflicts:
#	README.md
2023-04-11 22:39:57 +08:00
yadong.zhang
a7cb4aefc0 替换 justauth.wiki 域名,该域名暂时不可用,请使用 justauth.cn 2023-04-11 22:38:04 +08:00
yadong.zhang
7ffda8737c 替换 justauth.wiki 域名,该域名暂时不可用,请使用 justauth.cn 2023-04-11 22:34:18 +08:00
yadong.zhang
90a9d56fd0
替换 justauth.wiki 域名,该域名暂时不可用
Signed-off-by: yadong.zhang <yadong.zhang0415@gmail.com>
2023-04-11 14:25:54 +00:00
yadong.zhang
c53c763540
!36 新增afdian授权示例图
Merge pull request !36 from ヽ米 饭/handy
2023-03-25 09:41:31 +00:00
韩帅
dc18304eee feat: 新增afdian授权示例图 2023-03-24 16:50:37 +08:00
yadong.zhang
a558379680
!35 新增爱发电平台
Merge pull request !35 from ヽ米 饭/handy
2023-03-21 10:55:56 +00:00
韩帅
142846b2fa 新增爱发电平台 2023-03-21 17:42:46 +08:00
Christ
80b59fc13c fix: bug 58-63 scope在微软最新的文档中要求必须用空格隔开,form构建时候空格会被强制转换为%20,所以此处重新覆盖 2023-03-21 14:41:30 +08:00
yadong.zhang
765127e847 📝 更新文档 2023-02-26 18:09:08 +08:00
yadong.zhang
11707e6903 🔥 微信公众平台支持返回快照数据 2023-02-26 17:54:58 +08:00
yadong.zhang
3564c846f4 Merge branch 'master' of gitee.com:yadong.zhang/JustAuth into dev 2023-02-26 16:47:46 +08:00
yadong.zhang
0bc4c806bf ⬆️ Merge branch 'dev' 2023-02-26 16:47:27 +08:00
yadong.zhang
35c754f327 Merge branch 'master' of gitee.com:yadong.zhang/JustAuth 2023-02-26 16:32:19 +08:00
yadong.zhang
45ebe26f1b ⬆️ Merge branch 'dev' 2023-02-26 16:32:16 +08:00
yadong.zhang
30f4a29f48 Merge branch 'dev' of gitee.com:yadong.zhang/JustAuth 2023-02-26 16:27:49 +08:00
yadong.zhang
ca8e194c4e
Merge pull request #159 from cheng521521/master
添加飞书单元测试
2023-02-26 16:19:58 +08:00
yadong.zhang
81ea4b1620
Merge pull request #155 from marquis-chen/dev
企业微信网页登录--获取用户敏感信息
2023-02-26 16:19:28 +08:00
yadong.zhang
cc74d4a5c8
!33 【轻量级 PR】:update pom.xml.
Merge pull request !33 from test/N/A
2023-02-24 12:15:56 +00:00
test
e80304601f
update pom.xml.
升级fastjson版本到1.2.83,1.2.83版本之前存在代码执行漏洞风险 ,CVE-2022-25845	

Signed-off-by: test <531648642@qq.com>
2023-02-24 11:54:47 +00:00
yadong.zhang
afddf269e1
!31 修复企业微信的 redirect_uri 没有 urlEncode 问题
Merge pull request !31 from AlexChan/dev
2022-10-23 12:06:06 +00:00
alexchan
bac494a7fc 修复企业微信的 redirect_uri 没有 urlEncode 问题 2022-10-21 16:22:13 +08:00
chengpengxiang
7a9d602499 test:添加飞书单元测试 2022-10-03 13:17:28 +08:00
marquis chen
f3a8cf675c 企业微信网页登录增加AgentId参数,对重定向地址UrlEncode,获取用户敏感信息 2022-09-05 16:42:51 +08:00
yadong.zhang
571466f079
Merge pull request #149 from justauth/dependabot/maven/com.alibaba-fastjson-1.2.83
⬆️ Bump fastjson from 1.2.78 to 1.2.83
2022-08-07 22:59:14 +08:00
dependabot[bot]
e1b912bdf6
⬆️ Bump fastjson from 1.2.78 to 1.2.83
Bumps [fastjson](https://github.com/alibaba/fastjson) from 1.2.78 to 1.2.83.
- [Release notes](https://github.com/alibaba/fastjson/releases)
- [Commits](https://github.com/alibaba/fastjson/compare/1.2.78...1.2.83)

---
updated-dependencies:
- dependency-name: com.alibaba:fastjson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-17 02:05:50 +00:00
yadong.zhang
02674049d0 📝 更新说明 2021-10-18 10:03:14 +08:00
yadong.zhang
f1714726f5 Merge branch 'carldea/master' into dev 2021-10-18 09:55:40 +08:00
yadong.zhang
a3108caccf 🐛 修复 alipay 登录失败的 BUG 2021-10-16 19:11:24 +08:00
yadong.zhang
e134dd06b0 ⬆️ 升级alipay-sdk-version的依赖版本 2021-10-16 19:10:50 +08:00
yadong.zhang
172ba7be55 💩 修改用户logo的尺寸 2021-10-16 19:10:24 +08:00
Carl Dea
f9e3053ecc
Using TCK Tested JDK builds of OpenJDK
The AdoptOpenJDK has been discontinued since July 2021. When using Zulu you get all the latest updated (TCK Tested) builds for all versions of OpenJDK included archived major fixed versions.
2021-09-27 14:37:10 -04:00
Carl Dea
99c9ba2854
Using TCK Tested JDK builds of OpenJDK
The AdoptOpenJDK has been discontinued since July 2021. When using Zulu you get all the latest updated (TCK Tested) builds for all versions of OpenJDK included archived major fixed versions.
2021-09-27 14:36:33 -04:00
yadong.zhang
544ffd5372 💩 修复s一样的代码 2021-09-22 17:47:12 +08:00
yadong.zhang
522ebbfa7f 📝 编写文档 2021-09-22 17:16:43 +08:00
yadong.zhang
497498dbf4
Merge pull request #134 from verils/remove-provider-specific-properties
把Alipay独有的配置从AuthConfig里提取出来
2021-09-20 07:51:16 -05:00
yadong.zhang
62cd7af619
Merge pull request #133 from kang8/test
refactor: 重构 workflow
2021-09-20 07:43:28 -05:00
yadong.zhang
3a3f69692c 📝 编写文档 2021-09-20 20:39:49 +08:00
yadong.zhang
c87015e34f 📝 编写文档 2021-09-20 20:37:24 +08:00
yadong.zhang
96773dd92d ⬆️ 升级第三方的依赖 2021-09-20 20:37:10 +08:00
yadong.zhang
644ef02264 ⬆️ 升级 simple-http 到 1.0.5 2021-09-18 00:35:42 +08:00
verils
4c205a9957 把第三方服务独有的配置从AuthConfig里提取出来 2021-09-01 12:42:41 +08:00
kang
ea70c5fc81 ci: 快照版本切换,使用 python 脚本替换 maven 插件 2021-08-27 08:12:41 +08:00
kang
9ced525309 refactor: 重构流水线构建 2021-08-27 08:05:24 +08:00
yadong.zhang
2de0ad5013 !28 添加微软中国(世纪互联)第三方登录,新增微软方式登录的redirectUri校验
Merge pull request !28 from mroldx/dev
2021-08-26 12:06:43 +00:00
974751082@qq.com
23b7bcf43d 添加微软中国(世纪华联)第三方登录,新增微软方式登录的redirectUri校验 2021-08-25 23:06:29 +08:00
yadong.zhang
976b7d8b2b
Create FUNDING.yml 2021-08-16 12:09:01 +08:00
yadong.zhang
80132b69e7 💩 修改 AuthSource 中的 [企业微信二维码第三方登录] 2021-08-15 22:57:01 +08:00
yadong.zhang
95158654a9 📝 编写文档 2021-08-15 22:54:29 +08:00
yadong.zhang
f2e609192a 🔖 发布 1.16.3 版本 2021-08-15 22:52:58 +08:00
yadong.zhang
8c8f7a27a2 🙈 更新 .gitignore 文件 2021-08-15 22:52:41 +08:00
yadong.zhang
8283124c57 👽 增加 codechina 2021-08-15 22:52:24 +08:00
yadong.zhang
39b113b194 🐛 解决 Line 的 bug。Github Issue (#122) 2021-08-15 22:51:14 +08:00
yadong.zhang
e45ef2ec31 🔖 修改 since 编号 2021-08-15 22:49:33 +08:00
yadong.zhang
d114368a0d Merge branch 'master' into dev 2021-08-15 22:37:28 +08:00
yadong.zhang
0047cde50e
Merge pull request #128 from kang8/dev
[WIP] doc: 添加快照版本对应更详细的文档
2021-08-15 09:33:21 -05:00
yadong.zhang
f2c1c0f8a6
Merge pull request #127 from zheng-jx/master
企业微信第三方登录
2021-08-15 09:31:08 -05:00
kang
21e23aadb9 doc: 添加快照版本的文档编写 2021-08-14 23:57:14 +08:00
yadong.zhang
db3f7da181 📝 Writing docs. 2021-08-13 18:26:23 +08:00
yadong.zhang
004e5a180f 📝 Writing docs. 2021-08-13 18:06:14 +08:00
yadong.zhang
50c31e5dea
Merge pull request #126 from kang8/dev
[WIP] 添加发布快照的 workflow
2021-08-12 06:06:58 -05:00
zheng-jx
7d6049da67 企业微信第三方登录
接入链接https://open.work.weixin.qq.com/api/doc/90001/90143/91123
2021-08-11 15:50:39 +08:00
yadong.zhang
9a24553acd 🐛 预防 NPE 2021-08-11 11:03:08 +08:00
yadong.zhang
d75d91db0d 📝 补充文档说明 2021-08-11 10:57:25 +08:00
yadong.zhang
e1a4688ac0 📝 修复文案错误 2021-08-11 10:56:04 +08:00
yadong.zhang
b1d3790ae1 author 2021-08-11 10:54:43 +08:00
yadong.zhang
e5548b0173 🔖 修改版本号为 1.16.3 2021-08-11 10:51:25 +08:00
yadong.zhang
ebf39627dd 添加 AuthRequestBuilder 可以便捷的创建 AuthRequest 2021-08-11 10:49:45 +08:00
yadong.zhang
74ee17b242 !27 获取三方实例 部分 进行重构,使之可以进行更简单的获取对应的实例。
Merge pull request !27 from 陈宁/master
2021-08-10 10:06:19 +00:00
ngcly
b77de0bd0c 还原 2021-08-10 12:28:56 +08:00
ngcly
e55033f4f5 格式化 2021-08-10 10:27:01 +08:00
ngcly
37b7784f89 格式化 2021-08-10 10:24:36 +08:00
ngcly
7cdc719166 继续进行优化,去掉多余的改动 2021-08-10 10:18:42 +08:00
ngcly
5073f82897 1 2021-08-10 00:01:12 +08:00
ngcly
9971793f0c 获取三方实例 部分 进行重构,使之可以进行更简单的获取对应的实例。
如之前获取对应的实例:
        switch (source.toLowerCase()) {
            case "dingtalk":
                authRequest = new AuthDingTalkRequest(AuthConfig.builder()
                        .clientId("")
                        .clientSecret("")
                        .redirectUri("http://localhost:8443/oauth/callback/dingtalk")
                        .build());
                break;
            case "baidu":
                authRequest = new AuthBaiduRequest(AuthConfig.builder()
                        .clientId("")
                        .clientSecret("")
                        .redirectUri("http://localhost:8443/oauth/callback/baidu")
                        .scopes(Arrays.asList(
                                AuthBaiduScope.BASIC.getScope(),
                                AuthBaiduScope.SUPER_MSG.getScope(),
                                AuthBaiduScope.NETDISK.getScope()
                        ))
                        .build());
                break;
               }
上面需要调用端自己去根据source编码进行 new 对应的子类,这是不合理的。调用者应该只需要关心source码和对应的配置。
现在重构后,调用端只需要传入对应的source 和自定义的配置 通过统一的入口就可以拿到正确的实例。不需要调用端做各种判断,所有逻辑判断在服务端这边做好了处理。
调用端代码如下:
        AuthDefaultSource defaultSource = AuthDefaultSource.getAuthSource("wechat_mp");
        AuthRequest request = defaultSource.getAuthRequestInstance(AuthConfig.builder()
            .clientId("a")
            .clientSecret("a")
            .redirectUri("https://www.justauth.cn")
            .build());
2021-08-09 23:48:31 +08:00
kang
9fc3131640 test: 修复 twitter userInfo api 修改后测试同步问题 2021-08-07 11:28:20 +08:00
kang
3f4436bcb6 ci: add upload ossrh snapshotRepository config 2021-08-07 11:12:10 +08:00
kang
0678202baa ci: add deploy snapshot workflow 2021-08-07 11:07:52 +08:00
yadong.zhang
af8fda700b 📝 更新文档 2021-07-28 13:36:36 +08:00
yadong.zhang
881a87ed95 📝 修复 twitter 平台无法获取用户邮箱的问题 2021-07-28 09:53:44 +08:00
yadong.zhang
4c8fdbae49 📝 修复“淘宝”平台授权登录后没有uid的问题、增加刷新token的功能 2021-07-06 22:19:30 +08:00
yadong.zhang
e8db2dd282 📝 更新文档 2021-06-03 20:53:16 +08:00
yadong.zhang
90374762e4 增加“程序员客栈” 2021-06-03 15:18:51 +08:00
yadong.zhang
e5d44e91b8 👽 优化代码 2021-05-14 17:02:12 +08:00
yadong.zhang
41559fc954 📝 更新文档 2021-05-11 12:28:38 +08:00
yadong.zhang
d354278e7d 📝 更新文档 2021-05-11 12:27:15 +08:00
yadong.zhang
c2d6661a76 !24 update README.md. maxkey update
Merge pull request !24 from MaxKeyTop/N/A
2021-05-11 12:22:30 +08:00
MaxKeyTop
5ee87760be update README.md. maxkey update 2021-05-10 21:03:41 +08:00
yadong.zhang
94f6540338 📝 更新文档 2021-04-19 21:00:19 +08:00
yadong.zhang
7bc7a92efb 📝 更新文档 2021-04-19 14:05:22 +08:00
yadong.zhang
b5920872d5 Merge branch 'master' of github.com:justauth/JustAuth into dev 2021-04-19 14:03:25 +08:00
yadong.zhang
0bdf881849
Merge pull request #115 from leewenlong/patch-1
修正若干注释
2021-04-15 09:40:23 +08:00
yadong.zhang
46f7c72744 📝 更新文档 2021-04-12 11:41:43 +08:00
leewenlong
4a662ba5cd
Update AuthCodingRequest.java
修正注释
2021-04-10 18:02:33 +08:00
leewenlong
040587d5b2
Update AuthGithubScope.java
修正注释
2021-04-10 18:01:29 +08:00
leewenlong
c81411fd39
Update AuthBaiduScope.java
改正注释
2021-04-10 17:55:05 +08:00
yadong.zhang
0e1b000bd8 ⬆️ 升级 fastjsonv1.2.76 2021-04-09 08:44:53 +08:00
yadong.zhang
f9b30c735b 🔖 Update version to 1.16.1 2021-04-09 08:40:10 +08:00
yadong.zhang
0f42457d91 🐛 解决企业微信授权后,回调地址中原有的参数丢失的问题 2021-04-09 08:35:26 +08:00
yadong.zhang
fa75568996 抖音平台支持自定义 scope 2021-04-09 08:34:14 +08:00
yadong.zhang
f44ceeeeeb 增加忽略校验 redirectUri 的配置 2021-04-09 08:33:21 +08:00
yadong.zhang
ec4c009ed8 📝 更新文档 2021-04-08 09:43:34 +08:00
yadong.zhang
03fbbe0d3a 📝 更新文档 2021-04-07 20:52:04 +08:00
yadong.zhang
e64e9def63 📝 更新文档 2021-04-07 20:14:01 +08:00
yadong.zhang
25f99f7560 📝 更新文档 2021-04-07 20:12:22 +08:00
yadong.zhang
0433f54564 📝 更新文档 2021-04-07 19:26:07 +08:00
yadong.zhang
423d9f45b6 📝 更新文档 2021-04-07 19:25:23 +08:00
yadong.zhang
7a9e6214de 👽 集成 Okta 2021-03-30 23:26:56 +08:00
yadong.zhang
3753e3b9bc 👽 AuthConfig 中 CodingGroupName 改为 DomainPrefix 2021-03-30 23:25:30 +08:00
yadong.zhang
bc3af96328 👽 优化代码 2021-03-30 23:22:05 +08:00
yadong.zhang
b700902c04 📝 更新文档 2021-03-29 11:03:37 +08:00
yadong.zhang
2d0ae7cc27 📝 文档 2021-03-29 11:00:56 +08:00
yadong.zhang
3e4faa75fe 📝 更新脚本 2021-03-29 10:45:07 +08:00
yadong.zhang
6a36ad6af2 📝 更新文档 2021-03-29 10:44:44 +08:00
yadong.zhang
13514d6a92 调整 map 声明时的初始容量 2021-03-29 10:44:28 +08:00
yadong.zhang
6a479d9c1d 🥚 集成 Slack 和 Line 2021-03-29 10:43:47 +08:00
yadong.zhang
2e64fb9693 🥚 集成 Slack 2021-03-29 10:43:15 +08:00
yadong.zhang
0e8308e6c9 🥚 集成 Line 2021-03-29 10:42:57 +08:00
yadong.zhang
3933b3b7ee 🥚 增加钉钉账号登录 2021-03-19 14:37:37 +08:00
yadong.zhang
a99b818810 update CHANGELOGS.md. 2021-03-16 17:29:55 +08:00
yadong.zhang
cd324cc7c1 🔖 Release version 1.16.0 2021-03-13 23:15:22 +08:00
yadong.zhang
3e890f2c2a 📌 升级 FaceBook API 版本到 v10.0 2021-03-13 23:14:26 +08:00
yadong.zhang
ba56f5ab5a 🔧 facebook scope 增加默认值 2021-03-13 23:11:32 +08:00
yadong.zhang
132a7f4338 🥚 添加 amazon 平台 2021-03-13 23:10:48 +08:00
yadong.zhang
c79b97a0d0 !22 jdk8 maven打包编译报错: src\main\java\me\zhyd\oauth\config\JustAuthLogConfig.java:8: 错误: 未知标记: date
Merge pull request !22 from xhal/master
2021-03-04 08:47:26 +08:00
xhal
66df3ac027 update pom.xml - 1.8 javadoc 配置 2021-03-03 17:46:16 +08:00
xhal
11df93ad44 update pom.xml. 2021-03-03 17:06:08 +08:00
yadong.zhang
e3f5f49ec8 💡 更新帮助文档链接 2021-02-19 17:58:39 +08:00
yadong.zhang
23eb2cfcc8 💡 修改文档 2021-02-19 17:52:29 +08:00
yadong.zhang
30461e62f9 💡 修改文档 2021-02-19 17:51:14 +08:00
yadong.zhang
dfbbd9ae0d 💡 修改文档 2021-02-19 17:46:11 +08:00
yadong.zhang
05b7746f26 💡 修改文档 2021-02-19 17:37:23 +08:00
yadong.zhang
21422b02aa
Merge pull request #110 from hangsman/master
feat: 增加全局日志配置类
2021-01-15 18:33:28 +08:00
HeJin
10e445e87c feat: 增加全局日志配置类 2021-01-09 20:38:33 +08:00
yadong.zhang
d6cbcecaab 💡 修改注释、文档 2021-01-04 15:19:19 +08:00
yadong.zhang
050459e616 📝 Writing docs. 2021-01-01 18:28:43 +08:00
yadong.zhang
9fd2b9b919 🥚 正式启用飞书登录 2021-01-01 17:48:49 +08:00
yadong.zhang
2ff5570399 💡 更新注释 2021-01-01 15:22:30 +08:00
yadong.zhang
1bec384525 👽 重命名企业微信扫码登录 request 类名,补充文档说明 2021-01-01 15:20:57 +08:00
yadong.zhang
824c68356d 📌 升级 FaceBook API 版本到 v9.0 2021-01-01 10:40:18 +08:00
yadong.zhang
f5e3c225f6 📝 Writing docs. 2021-01-01 10:27:52 +08:00
yadong.zhang
0259669288 Merge branch 'dev' of github.com:justauth/JustAuth into dev 2021-01-01 10:10:20 +08:00
yadong.zhang
edc9d1a3c3
Merge pull request #107 from 937624219/dev
添加AuthAlipayRequest网络代理构造器
2021-01-01 10:03:30 +08:00
yadong.zhang
d886bc95a2
Merge pull request #105 from jianghuzai/WeChatEnterpriseWeb
支持企业微信网页授权登录
2021-01-01 09:56:40 +08:00
冬瓜
7aaf52e953 添加AuthAlipayRequest网络代理构造器 2020-12-27 11:08:57 +08:00
yadong.zhang
e84bd7cdb5 🔖 merge #101 2020-12-20 17:14:06 +08:00
guanhua.li
28e19960f2 支持企业微信网页授权登录 2020-12-16 10:02:37 +08:00
yadong.zhang
dce2bd1e1e
Merge pull request #101 from zwzch/dev
支持喜马拉雅登录
2020-12-09 13:18:52 +08:00
zwzch
bc30971482 优化代码
Signed-off-by: zwzch <zwzch4j@gmail.com>
2020-11-06 20:14:52 +08:00
zwzch
9bd6d88049 喜马拉雅登录
Signed-off-by: zwzch <zwzch4j@gmail.com>
2020-11-06 17:41:28 +08:00
yadong.zhang
442332be57 📝 Writing docs. 2020-11-02 21:30:23 +08:00
yadong.zhang
d4bfa8e75f 🔖 sponsors 2020-11-02 21:22:35 +08:00
yadong.zhang
fb90fbdcb8 Merge branch 'master' into dev 2020-10-25 11:04:55 +08:00
yadong.zhang
5f6cb2954f 🔖 Release version 1.15.8 2020-10-25 11:04:49 +08:00
yadong.zhang
906ae659a2
Merge pull request #96 from xkcoding/dev
⬆️ 升级 simple-http 版本 1.0.2->1.0.3,修复 jdk11 超时问题
2020-10-25 10:35:40 +08:00
Yangkai.Shen
cebfd99703 ⬆️ 升级 simple-http 版本 1.0.2->1.0.3,修复 jdk11 超时问题 2020-10-25 10:02:18 +08:00
yadong.zhang
71b6080156
Merge pull request #95 from justauth/dependabot/maven/junit-junit-4.13.1
⬆️ Bump junit from 4.11 to 4.13.1
2020-10-23 11:23:09 +08:00
dependabot[bot]
492ffdbbf8
⬆️ Bump junit from 4.11 to 4.13.1
Bumps [junit](https://github.com/junit-team/junit4) from 4.11 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.11.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.11...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-13 12:29:21 +00:00
yadong.zhang
dc4093bdf3 🔖 Release version 1.15.7 2020-09-11 17:05:24 +08:00
yadong.zhang
b71b081c96 🔖 Pre-Releasing / Version tags. 2020-08-24 19:30:07 +08:00
yadong.zhang
6b00783cd9 ⬆️ Upgrading dependencies. 2020-08-18 09:30:59 +08:00
yadong.zhang
2723f0dc3d 🔖 Pre-Releasing / Version tags 1.15.7-beta.3. 2020-08-18 09:17:22 +08:00
yadong.zhang
abbfb73337 🔖 Releasing / Version tags. 2020-08-15 20:48:18 +08:00
yadong.zhang
960892eec3 Adding tests. 2020-08-15 20:44:43 +08:00
yadong.zhang
4a6216f7d9 🎨 Improve the Microsoft platform's questions about scope. 2020-08-15 20:44:24 +08:00
yadong.zhang
ce689362ac 🐛 Fixing a bug for wechat. 2020-08-15 20:43:04 +08:00
yadong.zhang
e39d1dd0f8
Merge pull request #87 from justauth/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2020-07-22 22:46:14 +08:00
yadong.zhang
f5f1b1ccc0
Create CODE_OF_CONDUCT.md 2020-07-22 22:45:44 +08:00
yadong.zhang
d4104dd124 📝 Updating docs. 2020-07-22 22:22:34 +08:00
yadong.zhang
c17e56865b 📝 Updating docs. 2020-07-22 22:21:48 +08:00
yadong.zhang
8b55195225 🔖 Pre-Releasing / Version tags. 2020-07-22 22:20:17 +08:00
yadong.zhang
0398698657 🥚 Add issue and Pull Request templates for github 2020-07-22 22:15:14 +08:00
yadong.zhang
e15ecbe91e Merge branch 'pr_19' into dev
# Conflicts:
#	src/main/java/me/zhyd/oauth/request/AuthGoogleRequest.java
2020-07-22 17:54:51 +08:00
tanghao
9c332d6d16 修复通过google登录一次后,重新用google登录无法切换谷歌账户的问题。通过加prompt=select_account参数,可以每次当用户在登录页选择谷歌登录后,进入谷歌账户选择页面。prompt参数详见:https://m.imooc.com/wenda/detail/608928 2020-07-22 13:52:00 +08:00
yadong.zhang
d645224071 🔥 优化代码 2020-07-05 00:16:08 +08:00
yadong.zhang
272d1ac8a0 🔖 升级版本到1.15.7 2020-07-04 13:47:22 +08:00
yadong.zhang
162a16820d 👽 AuthScope + 包说明 2020-07-04 13:17:23 +08:00
yadong.zhang
2abef3dc64 🎨 完成微信公众平台的自定义 scope 2020-07-04 13:15:52 +08:00
yadong.zhang
e9fa31bc0d 🎨 完成 weibo 的自定义 scope 2020-07-04 13:04:32 +08:00
yadong.zhang
753774b193 🎨 完成 Stackoverflow 的自定义 scope 2020-07-04 12:52:55 +08:00
yadong.zhang
b01ebcaf48 🎨 完成人人网的自定义 scope 2020-07-04 12:24:09 +08:00
yadong.zhang
45e1195974 💩 改进部分代码结构 2020-07-04 11:05:19 +08:00
yadong.zhang
72bb1d826f 🎨 完成 qq 的自定义 scope 2020-07-04 10:31:53 +08:00
yadong.zhang
a85d9797a7 🎨 完成 Pinterest 的自定义 scope 2020-07-04 10:16:16 +08:00
yadong.zhang
6354182335 🎨 完成小米的自定义 scope 2020-07-04 01:49:06 +08:00
yadong.zhang
df11fcbd4c 🎨 完成微软的自定义 scope 2020-07-04 01:31:01 +08:00
yadong.zhang
36d4f89595 🎨 完成 linkedin 的自定义 scope 2020-07-03 19:03:31 +08:00
yadong.zhang
d787ba7346 🎨 完成酷家乐的自定义 scope 2020-07-03 18:33:07 +08:00
yadong.zhang
2d52e010da 🎨 完成京东·宙斯的自定义 scope 2020-07-03 18:28:34 +08:00
yadong.zhang
8440b0606e 🎨 完成华为的自定义 scope 2020-07-03 18:24:26 +08:00
yadong.zhang
cb30ddfa2f 🎨 完成 google 的自定义 scope,根据用途提供内置的 scope 集合方便客户端使用 2020-07-03 17:16:37 +08:00
yadong.zhang
a1ceb9bc7e 🎨 完成 gitlab 的自定义 scope 2020-07-03 15:45:33 +08:00
yadong.zhang
7df2c9af23 🎨 完成 github 的自定义 scope 2020-07-03 15:32:04 +08:00
yadong.zhang
f2c1c2f0ee 🎨 完成 gitee 的自定义 scope 2020-07-03 15:26:41 +08:00
yadong.zhang
cc04c1b616 🎨 完成 gitee 的自定义 scope 2020-07-03 15:26:28 +08:00
yadong.zhang
e02fcf895f 🎨 完成 facebook 的自定义 scope 2020-07-03 15:18:58 +08:00
yadong.zhang
d338e1bb98 🎨 facebook 支持自定义 scope 2020-07-02 23:34:23 +08:00
yadong.zhang
e11b8aff09 🎨 修改 scopes 的数据类型, 改为 List<String>, 方便客户端传递数据 2020-07-02 22:59:03 +08:00
yadong.zhang
6defde8283 coding、baidu支持自定义配置 scope 参数 2020-07-02 22:37:33 +08:00
yadong.zhang
8b3bc42678 Merge branch 'dev'
# Conflicts:
#	docs/references.md
2020-06-30 16:09:33 +08:00
yadong.zhang
164e12de1f 🔇 doc 文档迁移到 https://justauth.wiki 2020-06-30 16:08:31 +08:00
yadong.zhang
369388c11d 🎨 新增文档 + 增加阿里云登录刷新token的接口和支持忽略state校验的逻辑 2020-06-30 12:18:39 +08:00
yadong.zhang
a1200b2510 📝 添加 微信企业版 授权登录的文档 2020-06-29 01:07:43 +08:00
yadong.zhang
6ea1d41211 📝 更新文档 2020-06-29 00:44:04 +08:00
yadong.zhang
ddde4ef1f5 🔖 发布 1.15.6 2020-06-29 00:20:15 +08:00
yadong.zhang
26884f7218 📝 添加 Facebook 授权登录的文档 2020-06-28 22:43:39 +08:00
yadong.zhang
7f9c12d5bf 🔥 移除领英刷新token的接口。参考官网:To refresh an access token, go through the authorization process again to fetch a new token. 2020-06-28 22:10:38 +08:00
yadong.zhang
fbeb4c68ab 👽 AuthConfig 增加忽略校验 state 的参数 2020-06-28 22:09:12 +08:00
yadong.zhang
179287f720 👽 增加阿里云授权登录中刷新授权token的接口 2020-06-28 22:08:31 +08:00
yadong.zhang
8a47735208 📝 补充使用者文档 2020-06-28 21:54:08 +08:00
yadong.zhang
0feb859f68 📝 增加 Google 授权登录的文档 2020-06-28 21:53:46 +08:00
yadong.zhang
441dda3970 📝 增加 领英 授权登录的文档 2020-06-28 17:39:09 +08:00
yadong.zhang
b564ce8a89 📝 增加 开源中国 授权登录的文档 2020-06-28 16:22:04 +08:00
yadong.zhang
5e0065508a 📝 增加 dingtalk 授权登录的文档 2020-06-28 13:03:34 +08:00
yadong.zhang
cf6f42b586 📝 增加 baidu 授权登录的文档 2020-06-28 12:22:13 +08:00
yadong.zhang
89b5fe4543 Merge branch 'master' of https://gitee.com/yadong.zhang/JustAuth 2020-06-24 17:48:29 +08:00
yadong.zhang
6f313fa91a 🔖 发布 v1.15.5 2020-06-24 17:47:24 +08:00
yadong.zhang
36bcebdd46 📝 编写文档 2020-06-10 19:06:16 +08:00
yadong.zhang
99b8680fd2 更新抖音的链接 2020-06-10 17:20:17 +08:00
yadong.zhang
2717d9cf7a 🐛 解决抖音登录获取用户地址异常的问题 2020-06-10 17:18:35 +08:00
yadong.zhang
166ddffaf4 📝 Writing docs. 2020-06-07 18:48:55 +08:00
yadong.zhang
33385fd30a 🍻 AuthUser 中新增 rawUserInfo,用来存放第三方平台返回的原始用户数据 2020-06-07 18:46:00 +08:00
yadong.zhang
8e5a679129 Merge branch 'dev' of https://github.com/justauth/JustAuth into dev 2020-06-07 16:50:13 +08:00
yadong.zhang
5ab2e87157
Merge pull request #81 from snippet0809/master
支持阿里云授权登录
2020-06-07 16:49:40 +08:00
yadong.zhang
c34e226a54 🔀 合并 Gitee PR !15 2020-06-07 16:30:28 +08:00
yadong.zhang
e4985c63f3 Merge branch 'dev' of https://gitee.com/yadong.zhang/JustAuth into dev 2020-06-07 16:28:41 +08:00
yadong.zhang
e93ad07c5f 🔖 1.15.5-alpha 2020-06-07 16:28:27 +08:00
yadong.zhang
4ca1f46722 !15 修复人人网返回token中有竖线(|)没有进行URL Encode操作导致的url解析失败的bug
Merge pull request !15 from jingoo/dev
2020-06-07 16:23:25 +08:00
yadong.zhang
571c3438e4 📝 编写文档 2020-06-02 22:54:59 +08:00
yadong.zhang
2497519ec1 !17 fastjson 漏洞修复
Merge pull request !17 from harrylee/dev
2020-06-02 22:49:56 +08:00
yadong.zhang
278a435cdb 🔖 发布1.15.4-alpha(1.15.3-alpha不可用) 2020-06-02 22:44:29 +08:00
harrylee
e75df92080 🔒 fastjson 漏洞修复 2020-06-01 10:18:20 +08:00
崔子健
9e6a4c61b0 修复人人网返回token中有竖线(|)没有进行URL Encode操作导致的url解析失败的bug 2020-05-28 14:48:41 +08:00
Spet
d355699cc3 支持阿里云授权登录 2020-05-26 14:37:01 +08:00
yadong.zhang
28466f8ab5 📝 更新在线文档内容 2020-05-13 02:19:20 +08:00
yadong.zhang
c6bd5d9e5d 🔖 发布 1.15.3-alpha 解决推特登录异常的BUG 2020-05-13 00:58:03 +08:00
yadong.zhang
d0ae0f2c7a 🔖 临时发布 1.15.2-alpha 解决领英获取token发生异常的问题 2020-05-10 22:54:58 +08:00
yadong.zhang
521a423e26 🔖 临时发布 1.15.2-alpha 解决领英获取token发生异常的问题 2020-05-10 22:48:56 +08:00
yadong.zhang
1f1d61fe4e 🐛 修复 Gitee Issues#I1GPIB 2020-05-10 22:47:42 +08:00
yadong.zhang
ec87ea145c 🐛 解决 领英 获取token 401的问题 2020-05-10 22:43:15 +08:00
yadong.zhang
b1121ba545 📝 更新README 2020-05-02 21:21:11 +08:00
yadong.zhang
41d0d01329 📝 更新README 2020-05-02 21:20:45 +08:00
yadong.zhang
77603cf7db 📝 更新文档、facebook添加获取link属性 2020-04-17 23:51:59 +08:00
yadong.zhang
7be51f1d33 📝 更新文档 2020-04-10 17:37:20 +08:00
yadong.zhang
e71af6b2e6 📝 更新文档 2020-04-10 17:35:04 +08:00
yadong.zhang
54779ab26a 📝 更新文档 2020-04-10 16:42:04 +08:00
yadong.zhang
be1e23e2ab 📝 更新文档 2020-04-10 16:02:29 +08:00
yadong.zhang
739e7dfd39 🔖 发布一个版本, 1.15.1,1.15.0版有问题,请不要使用。抱歉 2020-04-10 15:53:14 +08:00
yadong.zhang
58c8aa9010 🔖 发布一个版本, 1.15.0 2020-04-10 15:46:29 +08:00
yadong.zhang
93aae33f0a 🔖 发布一个版本, 1.15.0 2020-04-10 15:45:27 +08:00
yadong.zhang
268a9b477b 🔖 发布一个版本, 1.15.0 2020-04-10 15:18:19 +08:00
yadong.zhang
adaf9d59cd
Merge pull request #69 from dengliming/master
Upgrade fastjson version
2020-04-10 15:16:01 +08:00
yadong.zhang
7f0f1e17d2 👽 等待simple-http发版, 解决使用apache-httpclient时的403bug 2020-04-09 22:58:34 +08:00
yadong.zhang
65b2db32b5 📝 编写文档 2020-04-08 01:06:56 +08:00
yadong.zhang
9e79dd7cb3 Merge branch 'master' into dev 2020-04-08 01:01:58 +08:00
yadong.zhang
30f29a49d1 📝 编写文档 2020-04-08 00:59:51 +08:00
yadong.zhang
129d1d57ed !14 【轻量级 PR】:update README.md.
Merge pull request !14 from shimingxy/N/A
2020-04-06 22:24:20 +08:00
shimingxy
3da90736c4 update README.md.
MaxKey使用JustAuth集成OAuth第三方认证
2020-04-06 22:05:01 +08:00
yadong.zhang
05891e48e9 公告 2020-04-05 00:29:55 +08:00
dengliming
9ef19b1d54 Upgrade fastjson version 2020-04-03 17:51:58 +08:00
yadong.zhang
2de19a3824 合并https://gitee.com/yadong.zhang/JustAuth/pulls/10,增加京东登录 2020-03-28 21:01:41 +08:00
yadong.zhang
bccf3279af 完善单测 2020-03-28 21:00:28 +08:00
yadong.zhang
6b4a8b78b1 📝 Writing docs. 2020-03-21 13:08:11 +08:00
yadong.zhang
5a94ff82c1 🍻 gitter 2020-03-21 12:44:09 +08:00
yadong.zhang
7b03751a8d 📝 Writing docs. 2020-03-21 12:39:55 +08:00
yadong.zhang
823a43b1e2 🔧 修改pom 2020-03-18 01:33:31 +08:00
yadong.zhang
db6e88173a 🔧 修改pom 2020-03-18 00:54:46 +08:00
yadong.zhang
c6481a681e 修改测试用例 2020-03-17 23:27:36 +08:00
yadong.zhang
1e1038fbd4 修改测试用例,增加scope为test的http工具依赖 2020-03-17 23:26:12 +08:00
yadong.zhang
7cb0f8dbb6 修改测试用例 2020-03-17 23:18:07 +08:00
yadong.zhang
65c60a61b3 🔖 发布1.14.0,解耦HTTP工具 2020-03-17 22:57:53 +08:00
yadong.zhang
d5a8ffcab2
Merge pull request #61 from githubeacon/master
增加飞书授权登录
2020-01-26 21:08:43 +08:00
yadong.zhang
c95c118f88
Merge pull request #65 from runningzyp/dev
更新文档
2020-01-26 21:07:13 +08:00
YunpengZhan
fec9a3c214
更新文档 2020-01-19 18:05:03 +08:00
yadong.zhang
6439058bda 📝 更新文档 2020-01-07 20:43:44 +08:00
beacon
a1d31018d3 增加飞书授权登录 2019-12-30 21:16:48 +08:00
yadong.zhang
2a9d8e81a1 Merge branch 'master' into dev
# Conflicts:
#	pom.xml
2019-12-26 12:36:52 +08:00
yadong.zhang
dda873ca11
Merge pull request #59 from xkcoding/extract-http
♻️ 抽取 HTTP,具体实现交给使用者,解耦 hutool-http
2019-12-26 12:35:52 +08:00
Yangkai.Shen
8dc4b5d7d6 ♻️ 抽取 HTTP,具体实现交给使用者,解耦 hutool-http 2019-12-25 18:28:18 +08:00
yadong.zhang
2038f24b3b Merge branch 'dev' 2019-12-24 19:37:33 +08:00
yadong.zhang
f8f13fdb10 Merge branch 'dev' of https://gitee.com/yadong.zhang/JustAuth into dev 2019-12-24 19:36:41 +08:00
yadong.zhang
697c07cccc 📝 更新文档,加入发版日期 2019-12-24 19:35:39 +08:00
yadong.zhang
e868d43ca3 🥚 添加实用工具,方便每次发版批量更新依赖版本 2019-12-24 19:34:39 +08:00
yadong.zhang
0700d7ee25 🔖 更新版本 2019-12-24 19:33:17 +08:00
yadong.zhang
822b4806a1 🍻 调整微信平台获取用户性别的代码逻辑,单独适配微信平台 2019-12-24 19:22:38 +08:00
yadong.zhang
ab8c24ee5c 🍻 调整过获取用户性别的逻辑 2019-12-24 18:47:57 +08:00
yadong.zhang
cd24cbdd58
Merge pull request #57 from xkcoding/wechat-mp
 集成微信公众号登录,修改之前的微信登录为微信开放平台登录
2019-12-24 11:00:18 +08:00
Yangkai.Shen
4bc9c09610 📝 修改文档,区分公众平台和开放平台 2019-12-23 13:54:27 +08:00
Yangkai.Shen
4d2518e21a 集成微信公众号登录,修改之前的微信登录为微信开放平台登录 2019-12-23 13:47:40 +08:00
yadong.zhang
f47dc074e7 update docs/index.html. 2019-12-23 09:54:52 +08:00
yadong.zhang
b7f01549c1 update docs/index.html. 2019-12-23 09:49:15 +08:00
yadong.zhang
264294caee 📝 添加微博授权登录的帮助文档 2019-12-22 20:03:22 +08:00
yadong.zhang
19ec565004 🍻 增加微博授权登录的revoke方法,支持手动回收授权 2019-12-22 20:02:26 +08:00
yadong.zhang
028924ecbf 📝 完善文档 2019-12-22 16:58:34 +08:00
yadong.zhang
d2d3232501 📝 完善文档 2019-12-22 16:52:32 +08:00
yadong.zhang
1206847576 📝 添加Gittalk 2019-12-22 16:34:42 +08:00
yadong.zhang
2490c0f1ff 📝 自定义404页面 2019-12-22 16:34:14 +08:00
yadong.zhang
2fd7255ad4 📝 支付宝登录文档的图片 2019-12-22 14:56:45 +08:00
yadong.zhang
f7873d71b2 📝 完善文档 2019-12-12 15:05:26 +08:00
yadong.zhang
602b1eaf58 📝 添加支付宝授权登录的帮助文档 2019-12-12 15:03:39 +08:00
yadong.zhang
7c2bc82814 🎨 优化 2019-12-12 14:47:57 +08:00
yadong.zhang
28b764f0d2 📝 添加qq授权登录的帮助文档 2019-12-12 11:48:27 +08:00
yadong.zhang
2442661291 📝 添加qq授权登录的帮助文档 2019-12-12 11:48:07 +08:00
yadong.zhang
abb121a57c 📝 添加qq授权登录的帮助文档 2019-12-12 11:47:54 +08:00
yadong.zhang
51603e18ad 📝 添加微信授权登录的帮助文档 2019-12-12 11:30:54 +08:00
yadong.zhang
77c9680333 📝 编写文档 2019-12-10 17:21:09 +08:00
yadong.zhang
525c406c92 🐛 修复抖音登录取值取错层级的问题(issue#I15SIG@Gitee) 2019-12-10 17:15:19 +08:00
yadong.zhang
e65d87daa3 Merge branch 'dev' of https://gitee.com/yadong.zhang/JustAuth into dev 2019-12-05 17:39:48 +08:00
yadong.zhang
8639359f53 ⬆️ 依赖升级 2019-12-05 17:39:08 +08:00
yadong.zhang
9eda5aaf2b !11 注解更新、包版本升级
Merge pull request !11 from 燃點/master
2019-12-05 17:34:34 +08:00
yadong.zhang
9d6ceb3898 💩 2019-12-05 17:20:31 +08:00
yadong.zhang
7bb9864799 !12 注解更新、包版本升级
Merge pull request !12 from 燃點/master
2019-11-15 17:56:36 +08:00
刘勋
95e4db2315 alipay-sdk-version 升级 4.8.10.ALL 2019-11-12 18:17:10 +08:00
刘勋
fc4606dad3 fastjson 升级到 1.2.62 2019-11-12 18:15:21 +08:00
刘勋
31330a366d hutool-http 升级到5.0.5 2019-11-12 18:14:51 +08:00
刘勋
7364c203ab 增加无参构造 2019-11-12 18:10:26 +08:00
yadong.zhang
c730072f07 📝 编写文档 2019-11-12 12:15:02 +08:00
yadong.zhang
3c3e9b63d5 🐛 拿我祭天前,先让我升级一下版本 2019-11-12 12:06:19 +08:00
yadong.zhang
100dacac91 🐛 拿我祭天吧 2019-11-12 12:04:00 +08:00
yadong.zhang
41dee559df 🐛 拿我祭天吧 2019-11-12 12:02:06 +08:00
yadong.zhang
b0769d09b3 Merge branch 'dev' of https://github.com/zhangyd-c/JustAuth into dev 2019-11-12 11:50:41 +08:00
yadong.zhang
c77c74be3c
Merge pull request #54 from jnan88/dev
fix#52 AuthCallback在spring中接收参数异常
2019-11-12 11:09:03 +08:00
qizai
66fdec3e2e fix#52 AuthCallback在spring中接收参数异常,需要有默认的构造方法,增加注解@AllArgsConstructor和@NoArgsConstructor 2019-11-08 12:06:21 +08:00
yadong.zhang
c674457f2f 📝 补充文档 2019-11-01 22:56:31 +08:00
yadong.zhang
0a0f6a34e8 📝 补充文档 2019-11-01 22:32:35 +08:00
yadong.zhang
366a6ac886 Merge branch 'dev' 2019-11-01 22:29:15 +08:00
yadong.zhang
15d03fcd07 📝 补充文档 2019-11-01 22:27:53 +08:00
yadong.zhang
c0b9010d84 google-site-verification 2019-10-31 11:29:30 +08:00
yadong.zhang
3cb7c0dd82 📝 补充文档 2019-10-26 17:46:25 +08:00
yadong.zhang
a23610c8b8 📝 补充文档:自定义state缓存、自定义实现oauth等 2019-10-26 17:43:21 +08:00
yadong.zhang
4e0fe3ba33 📝 补充文档:自定义state缓存、自定义实现oauth等 2019-10-26 17:41:59 +08:00
yadong.zhang
9f341389d2 🍻 集成推特 2019-10-22 18:16:31 +08:00
yadong.zhang
43459c3192
Merge pull request #49 from pengisgood/dev
Integrate Twitter
2019-10-09 10:01:19 +08:00
Hongwei Peng
de038b852d update doc 2019-09-30 10:19:53 +08:00
Hongwei Peng
da8ec82e74 refactor 2019-09-30 08:22:25 +08:00
Hongwei Peng
5ed7e1563b integrate twitter login 2019-09-30 08:11:21 +08:00
yadong.zhang
3e9fdf7c35 !9 增加序列化标识 解决直接引用Model序列化失败问题
Merge pull request !9 from -苏若年-/master
2019-09-25 15:23:58 +08:00
-苏若年-
427c5b6d38 序列化 2019-09-25 13:05:05 +08:00
-苏若年-
ea4beb71bc 序列化 2019-09-25 13:04:37 +08:00
-苏若年-
1334cd7378 序列化 2019-09-25 13:04:11 +08:00
-苏若年-
81eaca75ab 序列化 2019-09-25 13:03:41 +08:00
yadong.zhang
9e4815cde7 📝 修改demo链接 2019-09-23 09:16:21 +08:00
yadong.zhang
17630ea1bf 📝 修复文档错误 2019-09-22 01:31:18 +08:00
yadong.zhang
b8240ac210 🍻 文档、删除AuthRequestTest 2019-09-20 19:33:52 +08:00
yadong.zhang
3d7d37b651 🍻 文档、注释 2019-09-17 19:28:46 +08:00
yadong.zhang
94550e406f 🍻 文档 2019-09-17 19:17:55 +08:00
yadong.zhang
fdc78212ff 🍻 文档 2019-09-17 18:38:35 +08:00
yadong.zhang
51087658a4 🍻 完善饿了么授权登录 2019-09-11 19:46:16 +08:00
harrylee
469558bddc 集成京东 2019-09-11 15:06:50 +08:00
yadong.zhang
6567f17513 Merge branch 'master' into dev 2019-09-11 15:06:38 +08:00
yadong.zhang
6a3e061921 🍻 错别字 2019-09-11 11:18:35 +08:00
yadong.zhang
3a5a312b68 📝 编写文档 2019-09-11 11:16:31 +08:00
yadong.zhang
3ff0b36b49 Merge branch 'master' into dev 2019-09-11 09:20:10 +08:00
yadong.zhang
faae8816be 🍻 添加Nutzboot版Demo 2019-09-11 09:10:41 +08:00
yadong.zhang
6cf6a7d7dc Merge branch 'master' of https://gitee.com/yadong.zhang/JustAuth 2019-09-11 09:07:04 +08:00
harrylee
d9952968d1 📝 集成京东 2019-09-10 23:51:08 +08:00
yadong.zhang
c424f9c9c0 !6 添加Nutzboot版本的Demo地址
Merge pull request !6 from 蛋蛋的忧伤/master
2019-09-10 20:17:55 +08:00
王庆华
726018031f add: 添加NutzBoot版本的Demo,修改README 2019-09-10 19:28:56 +08:00
yadong.zhang
80f2dbdad7 提取公共的Source接口,支持自定义扩展第三方平台的授权登录,具体扩展例子可参考AuthExtendRequest 2019-09-06 22:21:35 +08:00
yadong.zhang
02f9f833e6 提取公共的Source接口,支持自定义扩展第三方平台的授权登录,具体扩展例子可参考AuthExtendRequest 2019-09-06 22:19:02 +08:00
yadong.zhang
05374e7a1f 集成“饿了么”授权登录(未测试) 2019-09-06 19:22:49 +08:00
yadong.zhang
1eacc41959 📝 编写文档 2019-09-06 16:56:29 +08:00
yadong.zhang
66c7455d30 集成美团,待发布1.12.0 2019-09-06 16:54:08 +08:00
yadong.zhang
055807d75f !5 fix: Fastjson < 1.2.60 远程拒绝服务漏洞预警
Merge pull request !5 from harrylee/master
2019-09-06 13:18:52 +08:00
harrylee
9b4e149953 fix: Fastjson < 1.2.60 远程拒绝服务漏洞预警
link: https://card.weibo.com/article/m/show/id/2309404413257925394542
2019-09-06 11:27:55 +08:00
yadong.zhang
2e16556968 📝 编写文档 2019-09-04 09:44:14 +08:00
yadong.zhang
c94b123a4b 集成Gitlab 2019-09-03 20:39:19 +08:00
yadong.zhang
ee1b6c8c5f 集成酷家乐 2019-09-03 09:14:50 +08:00
yadong.zhang
2be048ef0e
Merge pull request #45 from wuweiqi1993/kujialeAuth
Kujiale auth
2019-09-02 21:29:16 +08:00
shahuang
55fd335511 Merge branch 'kujialeAuth' of https://github.com/wuweiqi1993/JustAuth into kujialeAuth 2019-09-02 11:25:40 +08:00
shahuang
bb975f8eb3 移除用户额外信息 2019-09-02 11:24:59 +08:00
wuweiqi1993
13a388fb0f
Update README.md 2019-08-30 16:37:29 +08:00
wuweiqi1993
ff48e107c8
Update README.md 2019-08-30 16:36:21 +08:00
shahuang
de273d0482 add kujiale auth 2019-08-30 16:28:43 +08:00
yadong.zhang
16f77ec770 📝 编写文档 2019-08-23 20:05:26 +08:00
yadong.zhang
10df9f05f3 🔖 AuthUser添加构造函数,支持反序列化。发布1.10.1 2019-08-17 16:37:15 +08:00
yadong.zhang
fd183afd4a 📝 Writing docs. 2019-08-08 19:16:19 +08:00
yadong.zhang
d48a62d5cb Merge branch 'master' into dev 2019-08-07 11:02:12 +08:00
yadong.zhang
b466dd8de3 🍻 add package-info 2019-08-07 10:54:36 +08:00
yadong.zhang
4d8411e978 📝 编写文档 2019-08-06 18:26:50 +08:00
yadong.zhang
cf77e4d0e0 🔀 合并分支 2019-08-06 18:14:35 +08:00
yadong.zhang
4f303705d9 格式化代码 2019-08-06 18:01:18 +08:00
yadong.zhang
1fb8be6c82 Merge branch 'master' of https://github.com/zhangyd-c/JustAuth 2019-08-06 17:49:35 +08:00
yadong.zhang
48a368b516 合并pr,增加单测以及集成企业微信 2019-08-06 17:46:51 +08:00
yadong.zhang
6594d90a71
Merge pull request #35 from xkcoding/wechat-enterprise
 企业微信完成
2019-08-06 17:22:49 +08:00
yadong.zhang
31c983234f
Merge pull request #34 from Diffblue-benchmarks/add-tests-for-stringutils-2
Add tests for me.zhyd.oauth.utils.StringUtils
2019-08-06 17:14:41 +08:00
Yangkai.Shen
52682debfb 企业微信完成 2019-08-06 15:44:02 +08:00
yadong.zhang
d5e161eaef 📝 集成华为 2019-08-06 07:41:35 +08:00
yadong.zhang
1ab1cc124a 📝 集成华为 2019-08-05 22:32:35 +08:00
Chris Smowton
050686d85f Add unit tests for me.zhyd.oauth.utils.StringUtils
These tests were written using Diffblue Cover.
2019-08-05 15:12:37 +01:00
Chris Smowton
05f95b86b4 Prevent illegal redirect URI error in testing
Redirect URIs are now verified to ensure they contain "http://" or "https://"
prefixes, so we must supply a plausible URI in testing. This allows us to get
a step further when running `mvn test`.
2019-08-05 15:12:37 +01:00
yadong.zhang
665daa37b2 📝 集成华为 2019-08-05 22:05:58 +08:00
yadong.zhang
576402eec3 📝 文档 2019-08-05 18:34:09 +08:00
yadong.zhang
ec6c7a92b6 📝 删除根目录下的更新记录文档,挪到https://docs.justauth.whnb.wang中 2019-08-03 14:52:54 +08:00
yadong.zhang
d44cbd6e2b 📝 帮助文档 2019-08-03 14:47:36 +08:00
yadong.zhang
15caef01d3 📝 帮助文档 2019-08-03 14:45:18 +08:00
yadong.zhang
ad2e7c8231 📝 帮助文档 2019-08-03 14:41:11 +08:00
yadong.zhang
57a7b7ff17 📝 帮助文档 2019-08-03 14:35:51 +08:00
yadong.zhang
7a40159d15 📝 帮助文档 2019-08-03 14:28:31 +08:00
yadong.zhang
bcb27e4118 📝 帮助文档 2019-08-03 14:28:14 +08:00
yadong.zhang
0b9cb95103 📝 帮助文档 2019-08-03 14:27:54 +08:00
yadong.zhang
d61bb58b93 Merge branch 'master' into dev 2019-08-03 11:22:12 +08:00
yadong.zhang
d034722232 📝 修改文档 2019-08-03 11:21:58 +08:00
yadong.zhang
197f15dc4f Merge branch 'master' of https://gitee.com/yadong.zhang/JustAuth 2019-08-03 10:08:35 +08:00
yadong.zhang
fcb6fd9937 📝 Writing docs. 2019-08-03 10:07:56 +08:00
yadong.zhang
ce5c437289 🍻 规范代码注释 2019-08-03 09:49:49 +08:00
yadong.zhang
fabfff60c9
Merge pull request #32 from xkcoding/extract-cache
抽取缓存接口
2019-08-03 09:35:37 +08:00
yadong.zhang
d4296d160e
Merge branch 'dev' into extract-cache 2019-08-03 09:35:29 +08:00
yadong.zhang
d9967b2814 💡 添加源码注释 2019-08-02 20:47:10 +08:00
yadong.zhang
267b74bed7 📝 增加缓存配置、去掉slf4j依赖、增加Log工具类等 2019-08-02 20:41:06 +08:00
Yangkai.Shen
3e8c475d3f ♻️ 添加 Request 的 AuthStateCache 构造器 2019-08-02 14:57:13 +08:00
Yangkai.Shen
c1f9e96a92 修改 cache 测试类 2019-08-02 14:21:20 +08:00
Yangkai.Shen
bed01eef6d ♻️ 抽取 state 校验方法 2019-08-02 14:19:42 +08:00
Yangkai.Shen
909702e4da 添加私服仓库,开发时方便发布测试 2019-08-02 11:22:46 +08:00
Yangkai.Shen
57cb7fb0d1 抽取 cache 接口,方便用户自行集成 cache 2019-08-02 11:15:37 +08:00
yadong.zhang
b9c29c7534 更新"致谢"目录 2019-08-02 09:11:03 +08:00
yadong.zhang
6474c46505 Merge branch 'master' into dev 2019-08-01 17:13:34 +08:00
yadong.zhang
864665f1b8 📝 添加图标 2019-08-01 13:54:31 +08:00
yadong.zhang
83d23302f8 jacoco 2019-08-01 12:03:53 +08:00
yadong.zhang
ca1522adfd travis.yml 2019-08-01 07:43:19 +08:00
yadong.zhang
55459652b9 travis.yml 2019-08-01 06:50:33 +08:00
yadong.zhang
92bc4ab34a 测试hutool版本 2019-07-31 14:49:04 +08:00
yadong.zhang
4fab7561a4 测试hutool版本 2019-07-31 11:04:48 +08:00
yadong.zhang
16918ea13f 🔖 发布1.9.5,请使用1.9.5版本 2019-07-31 09:54:09 +08:00
yadong.zhang
eec26580c9 🚑 优化代码 2019-07-30 21:26:54 +08:00
yadong.zhang
421cabb176 🚑 优化代码 2019-07-30 21:19:55 +08:00
yadong.zhang
f71fce6858
Merge pull request #31 from xkcoding/refactor-1.9.3
调整部分代码
2019-07-30 21:15:50 +08:00
yadong.zhang
3199334ddc
Merge branch 'dev' into refactor-1.9.3 2019-07-30 21:15:12 +08:00
yadong.zhang
79417395a1 🍻 升级hutool,alipay-sdk改为provided,添加注释,state校验 2019-07-30 21:10:00 +08:00
Yangkai.Shen
06934b5242 ♻️ 格式化代码 2019-07-30 18:47:14 +08:00
Yangkai.Shen
fcaef297ff ♻️ 修改部分代码 2019-07-30 18:41:34 +08:00
yadong.zhang
e590077701 💡 修改注释 2019-07-30 10:34:48 +08:00
yadong.zhang
6ce26d4ce1 📝 更新文档 2019-07-30 09:36:30 +08:00
yadong.zhang
43d9ec8631 📌 修改程序版本 2019-07-30 09:34:17 +08:00
yadong.zhang
8e99e54519 Merge branch 'dev' 2019-07-30 09:13:26 +08:00
yadong.zhang
33076971fe 🔖 v1.9.3,详细更新内容参考update.md 2019-07-30 09:12:28 +08:00
yadong.zhang
a2d6dfe707 💡 规范注释 2019-07-27 07:55:52 +08:00
yadong.zhang
64aa1940e4 💡 优化注释 2019-07-27 07:34:01 +08:00
yadong.zhang
56c1e4ea35 📝 文档 2019-07-25 22:38:17 +08:00
yadong.zhang
ea1e1ba665 State优化第一步:去掉AuthState工具类 2019-07-25 22:33:24 +08:00
yadong.zhang
55c4b391bc State优化第一步:去掉AuthState工具类 2019-07-25 22:32:55 +08:00
yadong.zhang
094c297920 Merge branch 'dev' of https://github.com/zhangyd-c/JustAuth 2019-07-23 22:21:13 +08:00
yadong.zhang
7f725b579b
Merge pull request #29 from xkcoding/refactor-AuthState
♻️ 重载 AuthState 方法,适配 justauth-spring-boot-starter 直接使用
2019-07-23 22:20:52 +08:00
Yangkai.Shen
66a68c4ead ♻️ 重载 AuthState 方法,适配 justauth-spring-boot-starter 直接使用 2019-07-23 21:19:04 +08:00
yadong.zhang
504bf1cc7c
Merge pull request #28 from xkcoding/fix-lombok
🐛 修复 lombok 引入问题
2019-07-23 19:20:01 +08:00
Yangkai.Shen
97e7018795 🐛 修复 lombok 引入问题 [ISSUE#27](https://github.com/zhangyd-c/JustAuth/issues/27) 2019-07-22 20:08:34 +08:00
yadong.zhang
993dc687fc 🔖 配套starter:justauth-spring-boot-starter 2019-07-22 19:06:15 +08:00
yadong.zhang
38264616b4 🔖 发布1.9.2,修改AuthConfig类,适配spring starter配置 2019-07-22 17:54:33 +08:00
yadong.zhang
a75bac2cf7 🔖 发布1.9.2,修改AuthConfig类,适配spring starter配置 2019-07-22 17:30:18 +08:00
yadong.zhang
666d50b461 Merge branch 'master' into dev 2019-07-22 17:21:00 +08:00
yadong.zhang
7515301f50
Merge pull request #26 from xkcoding/refactor-AuthConfig
♻️ 添加注解,方便 justauth-spring-boot-starter 直接使用
2019-07-22 16:39:13 +08:00
Yangkai.Shen
cab222059c ♻️ 添加注解,方便 justauth-spring-boot-starter 直接使用 2019-07-22 15:29:48 +08:00
yadong.zhang
798e7556ba 🔖 增加stackoverflow参数校验、解决Pinterest获取用户失败的问题,发布v1.9.1 2019-07-20 17:21:21 +08:00
yadong.zhang
1244524da0 Merge branch 'master' of https://github.com/zhangyd-c/JustAuth 2019-07-19 22:28:35 +08:00
yadong.zhang
ce1f71c707 📌 version 2019-07-19 22:27:49 +08:00
yadong.zhang
93c301e05b 优化代码 2019-07-19 22:25:44 +08:00
yadong.zhang
53df992474 优化代码、修复google获取用户信息失败的问题 2019-07-19 22:00:07 +08:00
yadong.zhang
e29df531fa Merge branch 'dev'
# Conflicts:
#	example.md
#	src/main/java/me/zhyd/oauth/request/AuthMiRequest.java
#	src/main/java/me/zhyd/oauth/request/AuthWeChatRequest.java
#	src/main/java/me/zhyd/oauth/utils/UrlBuilder.java
2019-07-19 19:03:41 +08:00
yadong.zhang
3a04098e4c 优化代码 2019-07-19 18:05:24 +08:00
yadong.zhang
81691a3462 🍻 优化代码 2019-07-19 14:26:42 +08:00
yadong.zhang
6708525d99
Merge pull request #25 from dyc12ii/master
升级fastjson版本至1.2.58,避免安全漏洞
2019-07-19 11:19:44 +08:00
dingyanchao
a599ced6b0 fastjson version 2019-07-19 11:15:08 +08:00
yadong.zhang
f815f12acc 🍻 调整部分内容 2019-07-18 23:41:34 +08:00
yadong.zhang
78cb32a9f2 Merge branch 'dev' of https://gitee.com/yadong.zhang/JustAuth into dev 2019-07-18 22:48:56 +08:00
yadong.zhang
6505df15a7 🍻 调整部分内容 2019-07-18 22:48:23 +08:00
yadong.zhang
d7d87c7f04 更新 example.md 2019-07-18 22:42:14 +08:00
yadong.zhang
188e98c0f2 🍻 醉酒写代码 2019-07-18 21:59:05 +08:00
yadong.zhang
f2fb942808 🍻 醉酒写代码 2019-07-18 21:57:29 +08:00
yadong.zhang
d1d7587f4e 🔀 merge 2019-07-18 21:55:23 +08:00
yadong.zhang
d5e60165c0
Merge pull request #23 from xkcoding/remove-urlbuilder
♻️ 重构部分代码
2019-07-18 08:22:04 -05:00
yadong.zhang
d5189aa30c
Merge branch 'dev' into remove-urlbuilder 2019-07-18 08:21:13 -05:00
yadong.zhang
32c540cf1e
Merge pull request #22 from pengisgood/dev
add refresh token method
2019-07-18 08:13:10 -05:00
Hongwei Peng
9aa693d2da add refresh token method 2019-07-18 21:06:23 +08:00
Yangkai.Shen
0d4e52d615 ♻️ 移除 UrlBuilder 2019-07-18 20:37:41 +08:00
Yangkai.Shen
72792c3c83 🚨 新增编辑器规范,规范代码风格 2019-07-18 20:37:12 +08:00
yadong.zhang
a6f25ec312 更新 example.md 2019-07-18 19:27:08 +08:00
yadong.zhang
6dc42ac8b3 📝 编写文档 2019-07-18 19:25:23 +08:00
yadong.zhang
b67483c263
Merge pull request #21 from pengisgood/dev
Integrate Stack Overflow
2019-07-18 06:03:07 -05:00
Hongwei Peng
66ee684e1f refactor: extract common method 2019-07-18 18:23:45 +08:00
Hongwei Peng
d0375ce31a update document 2019-07-18 18:13:34 +08:00
Hongwei Peng
698c922b6b integrate stack overflow 2019-07-18 18:08:05 +08:00
Yangkai.Shen
5694d48288 🎨 增加部分工具类及方法、重载AuthState部分方法 2019-07-18 16:53:54 +08:00
yadong.zhang
44d4323fb2 更新 example.md 2019-07-18 15:51:42 +08:00
yadong.zhang
f7561e97fc 更新 example.md 2019-07-18 15:50:54 +08:00
yadong.zhang
e8cadef4ce 📝 编写文档 2019-07-18 15:29:16 +08:00
yadong.zhang
49f169abb9 📝 编写文档 2019-07-18 15:26:07 +08:00
yadong.zhang
917239a89a 📝 编写文档 2019-07-18 15:22:52 +08:00
yadong.zhang
5a5827a705 Merge branch 'dev' of https://github.com/zhangyd-c/JustAuth into dev 2019-07-18 15:14:38 +08:00
yadong.zhang
27583b15cc
Merge pull request #20 from pengisgood/dev
Integrate Pinterest
2019-07-18 15:12:50 +08:00
Hongwei Peng
090d7d3662 integrate Pinterest 2019-07-18 14:58:27 +08:00
Hongwei Peng
b5d8dbaede update contributor 2019-07-18 12:50:57 +08:00
yadong.zhang
a5da3b9765 🔀 合并github pr#19 2019-07-18 09:27:59 +08:00
yadong.zhang
ae1b5815d8 Merge branch 'dev' of https://github.com/zhangyd-c/JustAuth into dev 2019-07-18 09:20:26 +08:00
yadong.zhang
350f9d70ae
Merge pull request #19 from pengisgood/dev
Integrate Renren
2019-07-18 09:19:59 +08:00
Hongwei Peng
0ed3092d53 fix spelling 2019-07-17 21:37:36 +08:00
Hongwei Peng
8d1f700e7f integrate Renren 2019-07-17 21:36:16 +08:00
Hongwei Peng
d977e05a3d fix bug and enhance 2019-07-17 21:36:16 +08:00
yadong.zhang
abcdc105e0 📝 编写文档 2019-07-17 16:51:30 +08:00
yadong.zhang
267200c434 集成teambition 2019-07-17 15:29:18 +08:00
yadong.zhang
e0242f9929 集成teambition 2019-07-17 15:25:48 +08:00
yadong.zhang
59b5ba5a1b 🍻 醉酒写代码 2019-07-17 06:45:21 +08:00
yadong.zhang
12c6930182 🎨 调整throw信息的格式 2019-07-16 22:12:04 +08:00
yadong.zhang
a518e8c0cb
Merge pull request #18 from xkcoding/patch-5
♻️ 修复小米回调错误问题 同时 支持微信获取 unionId
2019-07-16 19:51:26 +08:00
yadong.zhang
4c1fdfc62d 🔀 手动合并PR #18 到dev分支 2019-07-16 19:49:18 +08:00
yadong.zhang
dc74501b1b 🔖 升级到1.9.0版本 2019-07-16 19:40:20 +08:00
yadong.zhang
8a4861075e ♻️ rename 2019-07-16 17:59:36 +08:00
yadong.zhang
65334d0f3f ♻️ 优化代码 2019-07-16 17:42:52 +08:00
yadong.zhang
67c668b740 ♻️ authorize方法提到父类中 2019-07-16 16:46:31 +08:00
yadong.zhang
7fe8a4d4bb ♻️ 从UrlBuilder中拆分alipay、baidu、coding、csdn、dingtalk、douyin、facebook和gitee相关的URL 2019-07-16 16:42:37 +08:00
yadong.zhang
4f272348da ♻️ 从UrlBuilder中拆分github、google、linkedin和microsoft相关的URL 2019-07-16 16:12:56 +08:00
yadong.zhang
ec31b7cbf7 ♻️ 从UrlBuilder中拆分小米和OSChina相关的URL 2019-07-16 15:50:44 +08:00
yadong.zhang
6b196456a1 ♻️ 从UrlBuilder中拆分qq、淘宝、腾讯云和头条相关的URL 2019-07-16 15:37:44 +08:00
yadong.zhang
af723a8b08 ♻️ 从UrlBuilder中拆分微信相关的URL 2019-07-16 15:11:18 +08:00
yadong.zhang
1360db60ae 💡 添加源码注释 2019-07-16 14:59:51 +08:00
Yangkai.Shen
8d1b329c63 微信登录获取unionId 2019-07-16 10:30:29 +08:00
yadong.zhang
47971438c7 拆分UrlBuilder工具类,已拆分WeiboRequest 2019-07-16 10:04:00 +08:00
Yangkai.Shen
e2e1a082d1 🐛 修复小米回调错误的问题 2019-07-16 10:01:17 +08:00
yadong.zhang
3b80e11824 💡 添加源码注释 2019-07-15 19:17:22 +08:00
yadong.zhang
44bb03d63f 新增AuthState类,内置默认的state生成规则和校验规则 2019-07-15 17:46:37 +08:00
yadong.zhang
bfe2122962 🎨 将枚举类移到enums包下 2019-07-15 10:40:42 +08:00
yadong.zhang
fa2b9114d1 📝 编写文档 2019-07-15 10:25:41 +08:00
yadong.zhang
93bee4f5d9 🔀 合并Braavos96提交的github PR #16 2019-07-12 09:47:03 +08:00
yadong.zhang
5c0b8eb94a
Merge pull request #16 from Diffblue-benchmarks/add-diffblue-tests
Add unit tests for me.zhyd.oauth.utils.GlobalAuthUtil
2019-07-12 09:29:25 +08:00
Eric Hettiaratchi
e03088a9b4 Add unit tests for me.zhyd.oauth.utils.GlobalAuthUtil
These tests were written using Diffblue Cover.
2019-07-10 14:29:21 +01:00
yadong.zhang
41a52767b3 📝 编写文档 2019-06-29 15:52:50 +08:00
yadong.zhang
88048b7637 📝 编写文档 2019-06-29 15:12:49 +08:00
yadong.zhang
186ee58b72 修改测试代码 2019-06-29 07:36:08 +08:00
yadong.zhang
fa51358072 📌 升级hutool版本 2019-06-28 23:08:09 +08:00
yadong.zhang
80329c2496 全面开启state校验 2019-06-28 22:58:34 +08:00
yadong.zhang
78988555b0 🍻 完善百度登录,增加gitee登录的state校验 2019-06-28 21:33:49 +08:00
yadong.zhang
ac4ede74bf 👽 修改login方法的参数为AuthCallback,封装回调返回的参数、支持state参数、增加code和state参数校验 2019-06-27 19:39:21 +08:00
yadong.zhang
9941ce7e2a Merge branch 'master' of https://gitee.com/yadong.zhang/JustAuth 2019-06-26 21:53:28 +08:00
yadong.zhang
4f594a4178 📝 更新githubapi文档 2019-06-26 21:52:16 +08:00
yadong.zhang
b9268f296b Merge remote-tracking branch 'origin/master' 2019-06-25 19:33:27 +08:00
yadong.zhang
1c30f6ab2f 🎨 适配qq授权登录时开发者账号没有申请unionId权限而导致报错的问题 2019-06-25 19:32:18 +08:00
yadong.zhang
af7baa924c 📝 Writing docs. 2019-06-22 08:10:09 +08:00
yadong.zhang
9902e7eb0d !4 优化微博登录
Merge pull request !4 from skqing/master
2019-06-22 07:43:45 +08:00
yadong.zhang
739fa786ce
Merge pull request #15 from xkcoding/patch-4
调整部分代码
2019-06-22 07:34:23 +08:00
Yangkai.Shen
6f1cead802 ♻️ 枚举类使用==替换equals,提高性能
参考:https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/comparing-java-enum-members-or-equals.md
2019-06-21 15:37:42 +08:00
Yangkai.Shen
374b71e5fe ♻️ 去除工具类方法,使用原生方法 2019-06-21 15:36:41 +08:00
Yangkai.Shen
9d1ab36e21 ♻️ 使用 StandardCharsets.UTF_8 替换 字符串UTF-8
1. 字符串形式的 utf-8 会抛异常
2. Charset 的性能要好
2019-06-21 15:34:38 +08:00
Yangkai.Shen
b8d9f2ebc9 🐛 修复小米 scope 错误 2019-06-21 15:32:30 +08:00
skqing
c201a9ac90 优化微博登录:
1.remind_in:该参数即将废弃,开发者请使用expires_in
2.uid作为openid,否则openid为空,理论上uid也是可以作为openid的
2019-06-21 11:29:20 +08:00
yadong.zhang
12ec6226bc 📝 编写文档 2019-06-20 10:28:29 +08:00
yadong.zhang
9a62332f30 📝 编写文档 2019-06-20 10:25:22 +08:00
yadong.zhang
a962c96a2c
Merge pull request #14 from xkcoding/refactor-v1.6.0-beta
🏗️ 架构调整,简化代码
2019-06-20 10:24:07 +08:00
yadong.zhang
d442018c02
Merge branch 'master' into refactor-v1.6.0-beta 2019-06-20 10:23:41 +08:00
yadong.zhang
8d6d4533e4 🔀 合并Gitee上的pr 2019-06-20 10:19:20 +08:00
yadong.zhang
2f88c23405 🔀 合并github中的pr 2019-06-20 10:10:18 +08:00
yadong.zhang
cf74f811fa 📝 编写文档 2019-06-19 20:01:03 +08:00
Yangkai.Shen
bb613010dc 🏗️ 架构调整,简化代码 2019-06-19 18:16:13 +08:00
skqing
7ace410351 解决抖音登录问题:
1.抖音的client_id换成client_key了
2.抖音的地址后面必须加上/否则报错
2019-06-19 17:14:14 +08:00
yadong.zhang
65daa0592a 🚑 增加alipay授权参数的验证,修改部分命名 2019-06-19 16:48:09 +08:00
yadong.zhang
25424023c4 🔀 合并代码 2019-06-19 10:10:20 +08:00
yadong.zhang
67579bfb07 🍻 qq登录时根据openid和unionid选择合适的值作为uuid 2019-06-19 10:06:15 +08:00
yadong.zhang
458de3840d Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java
#	src/main/java/me/zhyd/oauth/request/AuthQqRequest.java
2019-06-19 10:04:47 +08:00
yadong.zhang
1c1d2dc9db !2 修复最近提出一些问题和BUG
Merge pull request !2 from skqing/master
2019-06-19 10:01:59 +08:00
yadong.zhang
f5de7f93b5 🍻 解决Issue #IY1QR 增加对Config属性的校验功能,主要校验redirect uri的合法性 2019-06-19 09:56:28 +08:00
skqing
dcf5f30e61 修复以下问题:
QQ登录未获取真正的uuid
部分Request封装AuthUser时缺少gender属性
location属性设置方式不一致
钉钉登录获取用户信息忽略了openid
钉钉登录回调报错 bug
2019-06-19 09:51:43 +08:00
yadong.zhang
e534a4b62e 🍻 解决Issue #IY2FV 2019-06-18 19:56:00 +08:00
yadong.zhang
42ede32fc5 🍻 醉酒写代码 2019-06-18 19:51:53 +08:00
yadong.zhang
c0dd700b0a 🎨 解决Issue #IY2OH 2019-06-18 19:27:11 +08:00
yadong.zhang
f32c341b63 🎨 解决Issue #IY2HW 2019-06-18 19:21:05 +08:00
yadong.zhang
82358cbddb !1 修复钉钉回调JSON解析用户信息异常问题
Merge pull request !1 from skqing/master
2019-06-18 19:04:18 +08:00
skqing
56df9bc1b0 针对钉钉登录增加AuthToken属性 2019-06-18 14:55:28 +08:00
skqing
438660621e 解决钉钉回调异常问题 https://gitee.com/yadong.zhang/JustAuth/issues/IY1Z3 2019-06-18 14:20:05 +08:00
yadong.zhang
937fba37f5 📝 编写文档 2019-06-06 19:35:58 +08:00
yadong.zhang
fde490a205 🔖 增加今日头条的授权登陆。注:该版为beta版,因头条开发者申请的问题,并未经过测试。待测试通过后正式发布release版 2019-06-06 19:23:01 +08:00
yadong.zhang
da23fcd54c 🔖 增加今日头条的授权登陆。注:该版为beta版,因头条开发者申请的问题,并未经过测试。待测试通过后正式发布release版 2019-06-06 19:22:20 +08:00
yadong.zhang
36b5f333a4 🔖 发布1.5.1版本。注意:1.5.0版本因特殊原因已不可用! 2019-05-29 18:41:35 +08:00
yadong.zhang
d5e0ff3f33 💡 添加源码注释 2019-05-29 18:11:59 +08:00
yadong.zhang
b3aee449a2 📝 编写文档 2019-05-28 23:02:19 +08:00
yadong.zhang
f3619f48fe 🔖 增加小米账号和微软的授权登陆。发布1.5.0版本 2019-05-28 22:57:20 +08:00
yadong.zhang
e92f8961f5
Merge pull request #13 from xkcoding/feature-mi
 增加小米登录支持
2019-05-28 22:40:56 +08:00
Yangkai.Shen
a6ed65ce3d 增加小米登录支持 2019-05-28 19:26:10 +08:00
yadong.zhang
132c682673
Merge pull request #12 from xkcoding/feature-microsoft
 增加微软登录支持
2019-05-28 18:21:28 +08:00
Yangkai.Shen
4d92794b1a 增加微软登录支持 2019-05-28 15:58:41 +08:00
yadong.zhang
ae9edffc70 更新 README.md 2019-05-27 15:22:39 +08:00
yadong.zhang
7a6ff6c8e5 🔖 发布一个版本 2019-05-27 15:21:07 +08:00
yadong.zhang
b9ca048d1c ✏️ 修复部分问题,详情见update.md 2019-05-27 15:15:51 +08:00
yadong.zhang
a07dcbd26f ✏️ 修改钉钉图片的名字 2019-05-27 14:32:50 +08:00
yadong.zhang
3f67757a3a 支持抖音和领英,其他更新内容参考update.md 2019-05-27 11:43:56 +08:00
yadong.zhang
c951ffad59 📝 编写文档 2019-05-24 14:22:21 +08:00
216 changed files with 15766 additions and 3311 deletions

19
.editorconfig Normal file
View File

@ -0,0 +1,19 @@
# JustAuth 开发组IDE 编辑器标准
root = true
# 空格替代Tab缩进在各种编辑工具下效果一致
[*]
indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.java]
indent_size = 4
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

View File

@ -1,13 +1,12 @@
### 哪个平台?
为更快的帮您定位问题,推荐您用以下模板反馈问题:
### 1. 出现问题时,您做了哪些操作?
### 2. 在哪个步骤出现了问题?
### 重现步骤
### 报错信息
### 3. 您希望得到什么结果?
### 4. 您实际得到什么结果?
### 5. 请附上您出现问题的整屏截图或者整个异常堆栈信息

View File

@ -1,15 +1,29 @@
### 该Pull Request关联的Issue
- [ ] 是否为解决Issue
### 修改描述
### 您做了哪些更新?
- 新增
- 修改
- 修复
- 其他
### 是否做了充分测试?
- [ ] 是,已经做过测试,并且测试通过
- [ ] 否,还没做测试,需要作者自测
测试demo可以使用
- [simple版](https://github.com/justauth/JustAuth-demo)
- [jFinal版](https://github.com/xkcoding/jfinal-justauth-demo)
- [ActFramework版](https://github.com/xkcoding/act-justauth-demo)
- [Nutzboot版](https://github.com/EggsBlue/nutzboot-justauth-demo)
- [Blade版](https://github.com/justauth/blade-justauth-demo)
### 测试用例
### 修复效果的截屏

12
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://www.justauth.cn/sponsor.html']

32
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,32 @@
---
name: Bug report template
about: Please use this template for reporting suspected bugs.
title: 'bug:'
labels: 'bug'
assignees: ''
---
## Pre-submission checklist:
- [ ] I have searched the relevant information in the existing list of Issues.
- [ ] I have searched the developer documentation for that information: https://www.justauth.cn
- [ ] I have read the relevant Q&A: https://www.justauth.cn
## Issue description
## Environment
- JustAuth version(e.g. `1.15.1`):
### Minimal test code / Steps to reproduce the issue
1.
2.
3.
## What's the actual result? (including assertion message & call stack if applicable)
> Be sure to provide a complete and detailed exception stack.
## What's the expected result?

View File

@ -0,0 +1,15 @@
---
name: Feature Request
about: Please use this template for describing new features.
title: 'feat: '
labels: 'Feature Request'
assignees: ''
---
## Why did you add this feature?
## Feature description

15
.github/ISSUE_TEMPLATE/request-help.md vendored Normal file
View File

@ -0,0 +1,15 @@
---
name: Request help template
about: Please use this template for requesting help.
title: 'request help:'
labels: 'question'
assignees: ''
---
## Issue description
## Environment
- JustAuth version(e.g. `1.15.1`):

13
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,13 @@
## What this PR does / why we need it:
## Pre-submission checklist:
- [ ] Did you explain what problem does this PR solve?
- [ ] What new features have been added?
- [ ] Have you added corresponding test cases?
- [ ] Have you modified the corresponding document?
- [ ] Is this PR backward compatible?

65
.github/workflows/deploy-snapshot.yml vendored Normal file
View File

@ -0,0 +1,65 @@
name: Deploy
on:
push:
branches: [ dev ]
paths:
- src/**
- pom.xml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.2.0
- name: Set up Java and Maven
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
- name: Cache m2 package
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: mvn test
deploy-snapshot:
needs: test
if: ${{ success() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.2.0
- name: Set up Java and Maven
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Cache m2 package
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: setting snapshot version
run: |
import xml.etree.ElementTree as ET
tree = ET.parse("pom.xml")
version = tree.find("{http://maven.apache.org/POM/4.0.0}version")
print(version.text + "-SNAPSHOT")
if version.text.endswith("-SNAPSHOT") == False:
tree.find("{http://maven.apache.org/POM/4.0.0}version").text = version.text + "-SNAPSHOT"
ET.register_namespace("", "http://maven.apache.org/POM/4.0.0")
tree.write("pom.xml", "utf-8", True)
shell: python
- name: deploy snapshot to ossrh repository
run: mvn -B deploy -P snapshot -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

26
.github/workflows/test-pr.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: test pull_request
on:
pull_request:
paths:
- src/**
- pom.xml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.2.0
- name: Set up Java and Maven
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'zulu'
- name: Cache m2 package
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: mvn test

9
.gitignore vendored
View File

@ -25,6 +25,11 @@ hs_err_pid*
# exclude idea files
.idea
*.iml
*.sh
bin/codecov.sh
bin/deploy.sh
bin/docsify-cli.sh
target
target
/pom.xml.versionsBackup
/gpg
/PLAN.md

19
.travis.yml Normal file
View File

@ -0,0 +1,19 @@
language: java
sudo: false # faster builds
install: true
jdk:
- openjdk8
notifications:
email: false
script:
- export TZ=Asia/Shanghai
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- mvn cobertura:cobertura -Dcobertura.report.format=xml -Dmaven.javadoc.skip.true
after_success:
- bash <(curl -s https://codecov.io/bash)

581
CHANGELOGS.md Normal file
View File

@ -0,0 +1,581 @@
## 1.16.7
### 2024/12/14
- 新增
- 添加`微信小程序`登录能力,对接文档:[点击查看](https://justauth.cn/guide/oauth/wechat_mini_program/)。
- 添加`支付宝证书模式`登录能力(原支持的公钥登录模式依然可用),对接文档:[点击查看](https://justauth.cn/guide/oauth/alipay_cert)。
- 添加`appleid`社交登录能力,对接文档:[点击查看](https://justauth.cn/guide/oauth/appleid/)。 [Github#192](https://github.com/justauth/JustAuth/pull/192)
- 添加`QQ小程序`社交登录能力。 [Github#223](https://github.com/justauth/JustAuth/pull/223)
- 添加`figma`社交登录能力。 [Gitee#41](https://gitee.com/yadong.zhang/JustAuth/pulls/41)
- 添加新版`企业微信扫码`登录能力,对接文档:[点击查看](https://justauth.cn/guide/oauth/wechat_enterprise_qrcode_v2/)。 [Github Issue#165](https://github.com/justauth/JustAuth/issues/165)
- 添加新版`钉钉扫码`登录能力,对接文档:[点击查看](https://justauth.cn/guide/oauth/dingtalk_v2/)。 [Gitee Issue#I73FZL](https://gitee.com/yadong.zhang/JustAuth/issues/I73FZL)
- 添加新版`华为`登录能力,对接文档:[点击查看](https://justauth.cn/guide/oauth/huawei_v3/),原`AuthHuaweiRequest`会在后面版本被弃用,如有使用,请切换到`AuthHuaweiV3Request`
- 优化
- 修复文档错误。[Github #222](https://github.com/justauth/JustAuth/pull/222)
- 更新 Google 端点地址。[Github #198](https://github.com/justauth/JustAuth/pull/198)
- Amazon PKCE 中的 `code_verifier` 基于 `state` 缓存
- `AuthRequest`响应时携带泛型,避免二次解析。[Gitee#38](https://gitee.com/yadong.zhang/JustAuth/pulls/38)
- 优化业务调用方式:`getAccessToken``getUserInfo`两个方法从`AuthDefaultRequest`提升至`AuthRequest`中,部分场景下可以减少一次网络请求。[Github Issue#194](https://github.com/justauth/JustAuth/issues/194)
- ***注意:如果有基于 JustAuth 规范自定义实现的三方平台 Request[自定义第三方平台的OAuth](https://justauth.cn/features/customize-the-oauth/)),需要注意`getAccessToken``getUserInfo`接口的访问级别是否正确!!!***
- 其他
- 补充单侧,[Gitee#39](https://gitee.com/yadong.zhang/JustAuth/pulls/39)
## 1.16.6
### 2023/12/03
- 优化
- 微信公众平台支持返回快照标识(快照标识为 true 时,标识当前获取到的微信用户信息都是虚拟的)
- 企业微信网页登录--获取用户敏感信。 [Github #155](https://github.com/justauth/JustAuth/pull/155)
- 添加飞书单元测试。 [Github #159](https://github.com/justauth/JustAuth/pull/159)
- 升级fastjson版本到1.2.831.2.83版本之前存在代码执行漏洞风险 CVE-2022-25845。[Gitee PR #31](https://gitee.com/yadong.zhang/JustAuth/pulls/31)
- 新增
- 添加微软中国(世纪华联)第三方登录新增微软方式登录的redirectUri校验。[Gitee PR #33](https://gitee.com/yadong.zhang/JustAuth/pulls/33)
- 新增爱发电平台 [Gitee #35](https://gitee.com/yadong.zhang/JustAuth/pulls/35)
- 微软平台适配 AzureAD目前改名为 Microsoft Entra ID登录认证
- Fixed
- 修复 twitter 平台在 Java11 环境下登录失败的问题。[#174](https://github.com/justauth/JustAuth/issues/174)
- 修复 Facebook 平台无法登录的问题facebook 平台 API 进行了升级)
- 修复微信公众平台 scope 为 snsapi_base 登录报错的问题 [181](https://github.com/justauth/JustAuth/issues/181)
## 1.16.5
### 2021/10/18
- 合并 PR [Github #138](https://github.com/justauth/JustAuth/pull/138)
- 升级alipay-sdk-version的依赖版本
- 修改用户logo的尺寸
- 修复 alipay 登录失败的 BUG [Gitee Issue #I4E4ML](https://gitee.com/yadong.zhang/JustAuth/issues/I4E4ML)
## 1.16.4
### 2021/9/22
- 合并 PR
- [Github #134](https://github.com/justauth/JustAuth/pull/134)
- [Github #133](https://github.com/justauth/JustAuth/pull/133)
- [Github #132](https://github.com/justauth/JustAuth/pull/132)
- [Github #131](https://github.com/justauth/JustAuth/pull/131)
- 添加微软中国(世纪华联)第三方登录新增微软方式登录的redirectUri校验。[Gitee PR #28](https://gitee.com/yadong.zhang/JustAuth/pulls/28)
- 升级第三方的依赖
- simple-http > 1.0.5
- lombok > 1.18.20
- junit > 4.13.2
- fastjson > 1.2.78
- alipay-sdk > 4.16.38.ALL
## 1.16.3
### 2021/8/15
- 发布 v1.16.3
- 新增
- 集成“企业微信的第三方应用”平台登录
- PR
- `AuthRequst` 增加 `Builder` 构建方式,使用起来更简单。 ([#27](https://gitee.com/yadong.zhang/JustAuth/pulls/27))
- 使用 Github Action 添加发布快照的 workflow。 ([#126](https://github.com/justauth/JustAuth/pull/126))
- 新增了企业微信的第三方应用登录,`AuthWeChatEnterpriseThirdQrcodeRequest`。 ([#127](https://github.com/justauth/JustAuth/pull/127))
- 添加快照版本对应更详细的文档。 ([#128](https://github.com/justauth/JustAuth/pull/128))
- 修改
- 在 Gitee PR ([#27](https://gitee.com/yadong.zhang/JustAuth/pulls/27)) 的基础上重构代码,增加 Builder 方式创建 AuthRequest
- 解决 Line 登录的错误。[#122](https://github.com/justauth/JustAuth/issues/122)
## 1.16.2
### 2021/7/28
- 发布 v1.16.2
- 新增
- 集成“程序员客栈”平台登录
- 修改
- 更新文档
- 修复“淘宝”平台授权登录后没有`uid`的问题、增加刷新token的功能
- 修复“Twitter”平台授权登录后获取不到用户邮箱的问题
## 1.16.1
### 2021/4/19
- 发布 v1.16.1
- Fix Github issue [#114](https://github.com/justauth/JustAuth/issues/114): 解决企业微信授权后,回调地址中原有的参数丢失的问题
- Fix Github issue [#82](https://github.com/justauth/JustAuth/issues/82): 抖音平台支持自定义 scope
- Fix Github issue [#92](https://github.com/justauth/JustAuth/issues/92): 增加忽略校验 redirectUri 的配置
- Merge Github PR [#115](https://github.com/justauth/JustAuth/pull/115)
- 升级 `fastjson``v1.2.76`
## 1.16.0
### 2021/4/7
- 发布 v1.16.0
- 新增
- 集成 Amazon 平台登录
- 集成 Slack 平台登录
- 集成 LINE 平台登录
- 集成 Okta 平台登录
- 集成钉钉账号登录
- 修改
- 【**重要**】 `AuthConfig`中的`codingGroupName`参数更名为`domainPrefix`,针对此类平台提供通用的配置。
- 修改 `AuthFacebookScope` 中的默认 scope解决 justauth-demo 项目中使用 facebook 报错的问题
- 升级 facebook 的 api 到 v10.0 版本
- 优化部分代码
- 优化 Map 声明时的初始容量,避免频繁扩容
- 更新 README 文档
- PR
- 合并 [Github #110](https://github.com/justauth/JustAuth/pull/110)
- 合并 [Gitee #22](https://gitee.com/yadong.zhang/JustAuth/pulls/22)
## 1.15.9
### 2021/1/1
- 发布 v1.15.9
- 新增
- 修复并正式启用 飞书 平台的第三方登录
- AuthToken 类中新增 `refreshTokenExpireIn` 记录 refresh token 的有效期
- PR
- 合并 [Github #101](https://github.com/justauth/JustAuth/pull/101) :支持喜马拉雅登录
- 合并 [Github #105](https://github.com/justauth/JustAuth/pull/105) :支持企业微信网页授权登录
- 合并 [Github #107](https://github.com/justauth/JustAuth/pull/107) 添加AuthAlipayRequest网络代理构造器解决 Github Issue [#102](https://github.com/justauth/JustAuth/issues/102)
- 修改
- 修改喜马拉雅配置参数,将`ClientOsType`参数提到 AuthConfig 中
- AuthChecker 中增加对喜马拉雅平台的校验
- 升级 facebook api 版本到 v9.0,解决 Gitee Issue [#I2AR5S](https://gitee.com/yadong.zhang/JustAuth/issues/I2AR5S)
- **注意**!!!修改原来的企业微信 Request 类名为 `AuthWeChatEnterpriseQrcodeRequest`,升级后注意该点
注意:可能有些开发者对于 JA 集成的四个微信平台不太理解,这儿统一说明:
- 按照类名
- AuthWeChatEnterpriseQrcodeRequest企业微信二维码登录
- AuthWeChatEnterpriseWebRequest企业微信网页登录
- AuthWeChatOpenRequest微信开放平台
- AuthWeChatMpRequest微信公众平台
- 按照枚举
- WECHAT_ENTERPRISE企业微信二维码登录
- WECHAT_ENTERPRISE_WEB企业微信网页登录
- WECHAT_OPEN微信开放平台
- WECHAT_MP微信公众平台
## 1.15.8
### 2020/10/25
- Release version 1.15.8
- Merge the pr. [#95](https://github.com/justauth/JustAuth/pull/95) [#96](https://github.com/justauth/JustAuth/pull/96)
## 1.15.7
### 2020/09/11
- Release version 1.15.7
- Upgrade the use of access token when obtaining resources on the github platform.Reference from [Deprecating API authentication through query parameters](https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/)
- Fixed issue. [#89](https://github.com/justauth/JustAuth/issues/89)
## 1.15.7-beta.3
### 2020/08/24
- Fixing a bug for wechat.
- Improve the Microsoft platform's questions about scope.
## 1.15.7-beta.1
### 2020/08/05
- 新增
- 以下平台支持自定义 Scope 参数百度、coding、Facebook、gitee、github、gitlab、google、华为、京东·宙斯、酷家乐、领英、微软、小米、Pinterest、QQ、人人网、StackOverflow、微博、微信公众平台
- 添加 PR 和 ISSUE 规范和 CODE_OF_CONDUCT 文档
- 合并
- 合并 Gitee [PR#19](https://gitee.com/yadong.zhang/JustAuth/pulls/19)修复通过google登录一次后重新用google登录无法切换谷歌账户的问题。
## 1.15.6
### 2020/06/30
- 文档
- 新增 [百度登录](oauth/baidu.md)文档
- 新增 [钉钉登录](oauth/alipay.md)文档
- 新增 [开源中国登录](contributors.md)文档
- 新增 [领英登录](references.md)文档
- 新增 [Google 登录](references.md)文档
- 新增 [微信企业版登录](oauth/wechatEnterprise.md)文档
- 新增 [Facebook 登录](oauth/facebook.md)文档
- 完善 [JustAuth 使用者](users.md)文档
- 替换“帮助文档”域名,由[https://docs.justauth.whnb.wang](https://docs.justauth.whnb.wang)迁移到[https://www.justauth.cn](https://www.justauth.cn)
- 新增
- 增加阿里云授权登录中刷新授权token的接口by “QQ群用户需求”
- AuthConfig 增加忽略校验 state 的参数,详情参考:[Github#Issue#83](https://github.com/justauth/JustAuth/issues/83)
- 移除领英刷新token的接口。参考官网`To refresh an access token, go through the authorization process again to fetch a new token.`
## 1.15.5
### 2020/06/24
- BUG
- 解决 `Microsoft` 授权失败的 BUG
- 解决 `Coding` 个人账号授权失败的 BUG目前只能使用团队模式进行授权需要传入团队名参考`AuthConfig#codingGroupName`
- 解决 `AuthLinkedinRequest#getAvatar` NPE 的问题。(领英用户没有头像时,原代码会报 NPE
- 解决抖音登录获取用户地址异常的问题。
- 解决人人网登录时 token 中带有 `|` 引起的异常,[Gitee!15](https://gitee.com/yadong.zhang/JustAuth/pulls/15)
- 新增
- 支持阿里云授权登录,[Github#81](https://github.com/justauth/JustAuth/pull/81)
- AuthUser 中新增 `rawUserInfo`,用来存放第三方平台返回的原始用户数据。注:淘宝平台的`rawUserInfo`为一个空 JSON
- 支持 Http 级的代理配置,使用方式:
```java
new AuthGoogleRequest(AuthConfig.builder()
.clientId("")
.clientSecret("")
.redirectUri("http://127.0.0.1:8443/oauth/callback/google")
// 针对国外平台配置代理
.httpConfig(HttpConfig.builder()
.timeout(15000)
.proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)))
.build())
.build());
```
- 修改
- 升级 [simple-http](https://github.com/xkcoding/simple-http) 到 `v1.0.2`
- 升级 `fastjson``v1.2.71`
- 删除
- :boom: 删除**腾讯云登录**。coding 已并入 腾讯云,因此只保留 coding 登录 :boom:
- 文档
- 新增 [Coding登录](oauth/coding.md)文档
- 完善 [支付宝登录](oauth/alipay.md)文档
- 完善 [贡献者名单](contributors.md)文档
- 完善 [参考文档](references.md)文档
- PR
- 合并 [Gitee!17](https://gitee.com/yadong.zhang/JustAuth/pulls/17)
- 合并 [Gitee!15](https://gitee.com/yadong.zhang/JustAuth/pulls/15)
- 合并 [Github#81](https://github.com/justauth/JustAuth/pull/81)
- Issues
- 解决 [Github#80](https://github.com/justauth/JustAuth/issues/80)
- 解决 [Github#75](https://github.com/justauth/JustAuth/issues/75)
## 1.15.4-alpha
### 2020/05/13
- 修复
- 解决 Twitter 授权失败的BUG
- 文档
- 完善 [https://www.justauth.cn](https://www.justauth.cn/) 的404引导页内容
- 增加名词解释: `uuid`
- 补充 [Q&A](Q&A.md)
- 新增 [参考文档](references.md),包含 OAuth 授权和第三方平台的API文档等内容
- 新增 [推特登录](oauth/twitter.md) 的说明文档
> 特别注意所有国外平台都无法直接通过java进行访问API目前[simple-http](https://github.com/xkcoding/simple-http) Release版本暂不支持添加代理所以目前需要手动开启代理。
代理开启的方式:
```java
System.setProperty("proxyPort", "10080");
System.setProperty("proxyHost", "127.0.0.1");
```
以上代码可以在声明 `AuthRequest` 时创建,也可以全局执行。
本地如果支持科学上网就用自己本地的代理端口即可如果不支持科学上网可以去网上找一些免费的代理IP进行测试请自行操作
## 1.15.2-alpha
### 2020/05/10
- 修改
- 修复使用领英登录时无法获取token的问题
- 解决Gitee [Issue-I1GPIB](https://gitee.com/yadong.zhang/JustAuth/issues/I1GPIB)
【声明】:当引用 OkHttp 时,无法调用领英的授权登录,可能会抛出 400 异常。如遇此问题,请先切换到 hutool 或者 httpclient 依赖。
该问题尚在修复中,给各位带来的不便,深表歉意。
- hutool-http
```xml
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
<version>5.2.5</version>
</dependency>
```
- httpclient
```xml
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
```
## v1.15.1(~~v1.15.0~~)
### 2020/04/10
- 修改
- 更新开发文档
- 合并Gitee [PR-10](https://gitee.com/yadong.zhang/JustAuth/pulls/10),集成京东登录
- 合并Gitee [PR-14](https://gitee.com/yadong.zhang/JustAuth/pulls/14)修改帮助文档加入JA的使用者信息
- 合并Github [PR-69](https://github.com/justauth/JustAuth/pull/69)升级fastjson的最新版本
- 解决使用apache-httpclient时的403bug升级simple-http感谢QQ群的`不瘦十斤不改名字`反馈该问题
- 修复其他一些问题
【声明】由于本人的失误发布了一个错误的版本1.15.0目前1.15.0已发布,但是请不要使用,请直接升级到`1.15.1`
给各位造成的不便,深表歉意。
## v1.14.0
### 2020/03/17
- 修改
- 合并[PR-59](https://github.com/justauth/JustAuth/pull/59)抽取HTTP具体实现交给开发者解耦 hutool-http开发者可以视自己项目的依赖决定使用何种HTTP方式。详情请参考https://github.com/xkcoding/simple-http
- 合并[PR-65](https://github.com/justauth/JustAuth/pull/65),修改错误文案
- 修复其他一些问题
## v1.14.0
### 2020/03/17
- 修改
- 合并[PR-59](https://github.com/justauth/JustAuth/pull/59)抽取HTTP具体实现交给开发者解耦 hutool-http开发者可以视自己项目的依赖决定使用何种HTTP方式。详情请参考https://github.com/xkcoding/simple-http
- 合并[PR-65](https://github.com/justauth/JustAuth/pull/65),修改错误文案
- 修复其他一些问题
## v1.13.2
### 2019/12/24
- 新增
- 增加微信、QQ、支付宝、微博授权登录的帮助文档
- 合并[PR#57](https://github.com/justauth/JustAuth/pull/57),增加微信公众号登录 by [@xkcoding](https://github.com/xkcoding)
- [帮助文档](https://www.justauth.cn)中增加自定义的404页面
- [帮助文档](https://www.justauth.cn)中增加Gittalk插件
- [帮助文档](https://www.justauth.cn)中增加Java代码高亮的插件
- 增加`AuthUserGender#getWechatRealGender`方法,兼容获取微信平台的用户性别
- 修改
- 修复抖音登录取值取错层级的问题([issue#I15SIG@Gitee](https://gitee.com/yadong.zhang/JustAuth/issues/I15SIG)
- 完善异常提示的逻辑支持传入Source平台发生异常时显示对应的source平台
- `checkState`方法从`AuthDefaultRequest`中提出到`AuthChecker`
- `AuthResponseStatus`枚举类中增加`ILLEGAL_STATUS``REQUIRED_REFRESH_TOKEN`两个枚举值
- `AuthSource`接口中增加`getName`方法,用来对外提供实际`source`的字符串值
- `AuthWeiboRequest`微博授权登录中实现`revoke`方法,支持手动回收授权
- [帮助文档](https://www.justauth.cn)中修复[腾讯云登录]链接错误的问题
- 升级
- 升级相关依赖lombok@v1.18.10hutool@5.0.5fastjson@1.2.62alipay@4.8.10.ALL[PR#11@Gitee](https://gitee.com/yadong.zhang/JustAuth/pulls/11)
## v1.13.1
### 2019/11/12
- 修复[Issue#52](https://github.com/justauth/JustAuth/issues/52)解决AuthCallback异常的问题。请正在使用 `v1.13.0`的朋友升级到`v1.13.1`
## v1.13.0
### 2019/11/01
- 集成“推特”
- 完善文档
## v1.12.0
### 2019/09/06
- 集成“美团”授权登录
- 集成“饿了么”授权登录
- 升级Fastjson依赖到1.2.60,预防[“Fastjson 1.2.60 远程拒绝服务漏洞预警”](https://card.weibo.com/article/m/show/id/2309404413257925394542)
- 添加Nutzboot版的demo
- 提取公共的Source接口支持自定义扩展第三方平台的授权登录具体扩展例子可参考[AuthExtendRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/test/java/me/zhyd/oauth/request/AuthExtendRequest.java)
## v1.11.0
### 2019/09/03
- 集成“Gitlab”授权登录
### 2019/09/02
- 集成“酷家乐”授权登录
## v1.10.1
### 2019/08/17
- AuthUser添加构造函数支持反序列化
### 2019/08/08
- 项目迁移到组织[justauth](https://github.com/justauth)
## v1.10.0
### 2019/08/06
- 合并[PR-34](https://github.com/zhangyd-c/JustAuth/pull/34)添加StringUtil单元测试修复bug
- 合并[PR-35](https://github.com/zhangyd-c/JustAuth/pull/35),集成企业微信
### 2019/08/05
- 集成华为登录
- 修改`AuthChecker#checkCode`方法对于不同平台使用不同参数接受code的情况统一做处理
### 2019/08/03
合并github上[xkcoding](https://github.com/xkcoding) 的[pr#32](https://github.com/zhangyd-c/JustAuth/pull/32),抽取 cache 接口,方便用户自行集成 cache
### 2019/08/02
- 增加`AuthCache`配置类`AuthCacheConfig.java`,可以自定义缓存有效期以及是否开启定时任务
- 去掉`slf4j`依赖,封装`Log.java`工具类
- 规范测试类
## v1.9.5
### 2019/07/31
`v1.9.4`版本发布失败,请升级到`1.9.5`版本!
由此给您带来的不便,敬请谅解!
## v1.9.4
### 2019/07/30
1. 升级`hutool-http`版本到`v4.6.1`
2. 去除`AuthCallback`中增加的默认的校验state的方法挪到`AuthDefaultRequest`中做统一处理
3. `alipay-sdk-java`依赖改为`provided`如果需要使用支付宝登录需要使用方手动引入相关依赖具体操作方式见项目WIKI
4. 规范注释
## v1.9.3
### 2019/07/30
1. 规范注释
2. 增加State缓存`AuthCallback`中增加默认的校验state的方法
3. 增加默认的state生成方法参考`AuthStateUtils.java``UuidUtils.java`
4. 升级`hutool-http`版本到`v4.6.0`
5. 修复其他一些问题
### 2019/07/27
1. `IpUtils.getIp`改名为`IpUtils.getLocalIp`
2. 规范注释
### 2019/07/25
1. `AuthConfig`类中去掉state参数
2. 删除`AuthState`
3. 增加`authorize(String)`方法,并且使用`@Deprecated`标记`authorize()`方法
## v1.9.2
### 2019/07/22
1. 合并github上[xkcoding](https://github.com/xkcoding) 的[pr#26](https://github.com/zhangyd-c/JustAuth/pull/26)AuthConfig类添加lombok注解方便 [justauth-spring-boot-starter](https://github.com/xkcoding/justauth-spring-boot-starter) 直接使用
## v1.9.1
### 2019/07/22
1. 增加`stackoverflow`参数校验
2. 解决`Pinterest`获取用户失败的问题
3. 添加注释
## v1.9.0
### 2019/07/19
1. 合并github上[@dyc12ii](https://github.com/dyc12ii) 的[pr#25](https://github.com/zhangyd-c/JustAuth/pull/25)升级fastjson版本至1.2.58,避免安全漏洞
2. `AuthUserGender`枚举类挪到`enums`包下
3. 删除`AuthBaiduErrorCode``AuthDingTalkErrorCode`枚举类
4. 优化百度授权流程增加refresh token的方法
5. 优化`AuthConfig``AuthResponse`去掉不必要的lombonk注解减少编译后的代码量
6. 使用lombok注解优化枚举类
7. `AuthQqRequest`增加refresh方法
8. 修复google登录无法获取用户信息的问题
9. 优化代码
### 2019/07/18
1. 合并github上[@pengisgood](https://github.com/pengisgood) 的[pr#19](https://github.com/zhangyd-c/JustAuth/pull/19),集成人人
2. 合并github上[@pengisgood](https://github.com/pengisgood) 的[pr#20](https://github.com/zhangyd-c/JustAuth/pull/20)集成Pinterest
3. 合并github上[@pengisgood](https://github.com/pengisgood) 的[pr#21](https://github.com/zhangyd-c/JustAuth/pull/21)集成StackOverflow
4. 合并github上[@xkcoding](https://github.com/xkcoding) 的[pr#23](https://github.com/zhangyd-c/JustAuth/pull/23)重构代码、新增编辑器规范规范PR代码风格
### 2019/07/17
1. 优化代码
2. 集成Teambition登录
### 2019/07/16
1. 重构UrlBuilder类
2. 将CSDN相关的类置为`Deprecated`后续可能会删除也可能一直保留。毕竟CSDN的openAPI已经不对外开放了。
3. `BaseAuthRequest` 改名为 `AuthDefaultRequest`
4. `ResponseStatus` 改名为 `AuthResponseStatus` 并且移动到 `me.zhyd.oauth.model`
5. 合并github上[@xkcoding](https://github.com/xkcoding) 的[pr#18](https://github.com/zhangyd-c/JustAuth/pull/18),修复小米回调错误问题 同时 支持微信获取unionId
## v1.8.1
### 2019/07/15
1. 新增 `AuthState`内置默认的state生成规则和校验规则
### 2019/07/12
1. 合并[Braavos96](https://github.com/Braavos96)提交的[PR#16](https://github.com/zhangyd-c/JustAuth/pull/16)
## v1.8.0
### 2019/06/28
1. 修复百度登录获取不到token失效时间的问题
2. 增加state参数校验预防CSRF。**强烈建议启用state**
### 2019/06/27
1. 修复百度登录获取不到token失效时间的问题
2. 增加state参数校验预防CSRF。**强烈建议启用state**
3. 修改login方法的参数为AuthCallback封装回调返回的参数
4. 支持state参数
5. 增加code和state参数校验
由于state安全问题1.8.0以前的版本都有隐藏的CSRF漏洞问题所以强烈建议正在使用JustAuth的朋友升级到1.8.0版本!
## v1.7.1
### 2019/06/25
qq授权登录时需要获取`openId`作为`uuid`,在`1.6.1-beta``1.7.0`版本中,引入了`unionId`这一属性。获取`unionid`需要单独向qq团队**发送邮件**申请权限,鉴于这一申请权限的步骤比较麻烦(需要填写的内容比较多),所以在`AuthConfig`中增加了一个`unionId`属性,当为**true**时才会获取unionid当为false时只获取openId。如果你需要该功能 则在自行申请了相关权限后将该属性置为true即可。关于unionId的参考链接[UnionID介绍](http://wiki.connect.qq.com/unionid%E4%BB%8B%E7%BB%8D)
## v1.7.0
### 2019/06/19
1. 合并[xkcoding](https://github.com/xkcoding)提交的[PR](https://github.com/zhangyd-c/JustAuth/pull/14)重构了部分代码jar包由原来的`130+kb`优化到现在的`110+kb`
2. 合并[skqing](https://gitee.com/skqing)提交的[PR](https://gitee.com/yadong.zhang/JustAuth/pulls/3) 解决抖音登录失败问题
## v1.6.1-beta
### 2019/06/18
1. 解决Issue [#IY2HW](https://gitee.com/yadong.zhang/JustAuth/issues/IY2HW)
2. 解决Issue [#IY2OH](https://gitee.com/yadong.zhang/JustAuth/issues/IY2OH)
3. 解决Issue [#IY2FV](https://gitee.com/yadong.zhang/JustAuth/issues/IY2FV)
4. 修复部分注释、拼写错误
5. 解决Issue [#IY1QR](https://gitee.com/yadong.zhang/JustAuth/issues/IY1QR) 增加对Config属性的校验功能主要校验redirect uri的合法性
6. 合并[skqing](https://gitee.com/skqing)提交的[PR](https://gitee.com/yadong.zhang/JustAuth/pulls/2)解决一些BUG
## v1.6.0-beta
### 2019/06/06
1. 增加今日头条的授权登陆
2. 发布1.6.0-beta版本今日头条开发者暂时不能认证 所以无法做测试等测试通过后正式发布release版本
## v1.5.0
### 2019/05/28
1. 增加小米账号和微软的授权登陆
2. 发布1.5.0版本
## v1.4.0
### 2019/05/26
1. 增加抖音和Linkedin的授权登陆
2. 修改部分图片命名
3. 优化部分代码
4. 修复`AuthSource`中腾讯云开发平台的拼写错误:`TENCEN_CLOUD`->`TENCENT_CLOUD`
5. 修复支付宝登陆时用户名为空的问题
## v1.3.3
### 2019/05/24
1. 修复一些问题
2. 升级api在AuthUser中增加`uuid`属性,可以通过`uuid` + `source`唯一确定一个用户,此举解决了用户身份归属的问题。
3. 发布1.3.3版本的jar包到公开仓库1.3.2忘记发布了,( ╯□╰ )
4. 重要经咨询官方客服得知CSDN的授权开放平台已经下线如果以前申请过的应用可以继续使用但是不再支持申请新的应用。so, 本项目中的CSDN登录只能针对少部分用户使用了
## v1.3.1
### 2019/05/23
1. 修复QQ登录的问题
2. 发布1.3.1版本的jar包到公开仓库
## v1.3.0
### 2019/05/21
1. 新增google授权登录
2. 新增facebook授权登录
3. 发布1.3.0版本的jar包到公开仓库
## v1.1.0
### 2019/05/18
1. 发布1.1.0版本的jar包到公开仓库支持qq和微信登录
2. 支持淘宝登录
3. 修改`AuthUser.java`类中的`accessToken`属性,由原本的~~accessToken (String)~~改为`token (AuthToken)`
4. 修复一些bug
5. 发布1.2.0版本的jar包到公开仓库支持淘宝登录
### 2019/05/17
1. 增加qq和微信的授权登录
2. 修改getAccessToken方法的返回值
## v1.0.1
### 2019/03/27
集成 支付宝授权登录
## v1.0.0
### 2019/03/25
史上最全的整合第三方登录的工具,目前已支持Github、Gitee、微博、钉钉和百度、Coding、腾讯云开发者平台和OSChina登录。 Login, so easy!

76
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at yadong.zhang0415@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

199
README.en-US.md Normal file
View File

@ -0,0 +1,199 @@
<p align="center">
<a href="https://www.justauth.cn"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/Justauth.png" width="400"></a>
</p>
<p align="center">
<strong>Login, so easy.</strong>
</p>
<p align="center">
<a target="_blank" href="https://search.maven.org/search?q=JustAuth">
<img src="https://img.shields.io/github/v/release/justauth/JustAuth?style=flat-square" ></img>
</a>
<a target="_blank" href="https://oss.sonatype.org/content/repositories/snapshots/me/zhyd/oauth/JustAuth/">
<img src="https://img.shields.io/nexus/s/https/oss.sonatype.org/me.zhyd.oauth/JustAuth.svg?style=flat-square" ></img>
</a>
<a target="_blank" href="https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE">
<img src="https://img.shields.io/apm/l/vim-mode.svg?color=yellow" ></img>
</a>
<a target="_blank" href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" ></img>
</a>
<a target="_blank" href="https://www.justauth.cn" title="参考文档">
<img src="https://img.shields.io/badge/Docs-latest-blueviolet.svg" ></img>
</a>
<a href="https://codecov.io/gh/justauth/JustAuth">
<img src="https://codecov.io/gh/justauth/JustAuth/branch/master/graph/badge.svg?token=zYiAqd9aFz" />
</a>
<a href='https://gitee.com/yadong.zhang/JustAuth/stargazers'>
<img src='https://gitee.com/yadong.zhang/JustAuth/badge/star.svg?theme=gvp' alt='star'></img>
</a>
<a target="_blank" href='https://github.com/zhangyd-c/JustAuth'>
<img src="https://img.shields.io/github/stars/zhangyd-c/JustAuth.svg?style=social" alt="github star"></img>
</a>
</p>
-------------------------------------------------------------------------------
<p align="center">
<img src='./docs/media/75a3c076.png' alt='star'></img>
</p>
-------------------------------------------------------------------------------
`JustAuth`, as you see, It is just a Java library of third-party authorized login, It's smaller and easier to use. JustAuth is the best third-party login tool written in JAVA.
Source Code[gitee](https://gitee.com/yadong.zhang/JustAuth) | [github](https://github.com/zhangyd-c/JustAuth)
Docs[Reference Doc](https://www.justauth.cn)
## Features
1. **Multiple platform**: Has integrated more than a dozen third-party platforms.([plan](https://gitee.com/yadong.zhang/JustAuth/issues/IUGRK))
2. **Minimalist**: The minimalist design is very simple to use.
## Quick start
### Add maven dependency
- Add JustAuth dependency
These artifacts are available from Maven Central:
```xml
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>{latest-version}</version>
</dependency>
```
> **latest-version**
> - CURRENT: ![](https://img.shields.io/github/v/release/justauth/JustAuth?style=flat-square)
> - SNAPSHOT: ![](https://img.shields.io/nexus/s/https/oss.sonatype.org/me.zhyd.oauth/JustAuth.svg?style=flat-square)
- Add http dependencyOnly need one
> If there is already in the project, please ignore it. In addition, you need to pay special attention. If the low version of the dependency has been introduced in the project, please exclude the low version of the dependency first, and then introduce the high version or the latest version of the dependency
- hutool-http
```xml
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
<version>5.2.5</version>
</dependency>
```
- httpclient
```xml
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
```
- okhttp
```xml
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.4.1</version>
</dependency>
```
### Using JustAuth API
#### Simple
```java
// Create authorization request
AuthRequest authRequest = new AuthGiteeRequest(AuthConfig.builder()
.clientId("clientId")
.clientSecret("clientSecret")
.redirectUri("redirectUri")
.build());
// Generate authorization page url
authRequest.authorize("state");
// Get token and userinfo
authRequest.login(callback);
```
#### Builder 1. Use unchanging `AuthConfig`
```java
// Create authorization request
AuthRequest authRequest = AuthRequestBuilder.builder()
.source("github")
.authConfig(AuthConfig.builder()
.clientId("clientId")
.clientSecret("clientSecret")
.redirectUri("redirectUri")
.build())
.build();
```
#### Builder 2. Use dynamic `AuthConfig`
```java
// Create authorization request
AuthRequest authRequest = AuthRequestBuilder.builder()
.source("gitee")
.authConfig((source) -> {
// Use source to dynamically get AuthConfig
// Here you can flexibly take the configuration from sql or take the configuration from the configuration file
return AuthConfig.builder()
.clientId("clientId")
.clientSecret("clientSecret")
.redirectUri("redirectUri")
.build();
})
.build();
```
#### Builder 3. Support custom platform
```java
AuthRequest authRequest = AuthRequestBuilder.builder()
// Key point: configure the custom implementation of AuthSource
.extendSource(AuthExtendSource.values())
// Enum name in AuthExtendSource
.source("other")
// ... Do other things
.build();
```
## Contributions
1. Fork this project to your repository
2. Clone the project after fork.
3. Modify the code (either to fix issue, or to add new features)
4. Commit and push code to a remote repository
5. Create a new PR (pull request), and select `dev` branch
6. Waiting for author to merge
I look forward to your joining us.
## Contributors
[contributors](https://www.justauth.cn/contributors.html)
## Change Logs
[CHANGELOGS](https://www.justauth.cn/update.html)
## Recommend
- `spring-boot-demo` In-depth study and actual combat of spring boot projects: [https://github.com/xkcoding/spring-boot-demo](https://github.com/xkcoding/spring-boot-demo)
- `mica` Efficient Development of scaffolding by Spring Cloud: [https://github.com/lets-mica/mica](https://github.com/lets-mica/mica)
- `pig` Cosmic strongest Micro Services Certified authorized scaffolding (essential for Architects): [https://gitee.com/log4j/pig](https://gitee.com/log4j/pig)
- `SpringBlade` Complete online solution (necessary for enterprise development): https://gitee.com/smallc/SpringBlade
## References
- [The OAuth 2.0 Authorization Framework](https://tools.ietf.org/html/rfc6749)
- [OAuth 2.0](https://oauth.net/2/)

329
README.md
View File

@ -1,12 +1,15 @@
<p align="center">
<a href="https://www.justauth.cn/"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/logo.png" width="400"></a>
<a href="https://www.justauth.cn"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/Justauth.png" width="400"></a>
</p>
<p align="center">
<strong>Login, so easy.</strong>
</p>
<p align="center">
<a target="_blank" href="https://search.maven.org/search?q=JustAuth">
<img src="https://img.shields.io/badge/Maven Central-1.3.1-blue.svg" ></img>
<img src="https://img.shields.io/github/v/release/justauth/JustAuth?style=flat-square" ></img>
</a>
<a target="_blank" href="https://oss.sonatype.org/content/repositories/snapshots/me/zhyd/oauth/JustAuth/">
<img src="https://img.shields.io/nexus/s/https/oss.sonatype.org/me.zhyd.oauth/JustAuth.svg?style=flat-square" ></img>
</a>
<a target="_blank" href="https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE">
<img src="https://img.shields.io/apm/l/vim-mode.svg?color=yellow" ></img>
@ -14,48 +17,132 @@
<a target="_blank" href="https://www.oracle.com/technetwork/java/javase/downloads/index.html">
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" ></img>
</a>
<a target="_blank" href="https://www.justauth.cn" title="参考文档">
<img src="https://img.shields.io/badge/Docs-latest-blueviolet.svg" ></img>
</a>
<a href="https://codecov.io/gh/justauth/JustAuth">
<img src="https://codecov.io/gh/justauth/JustAuth/branch/master/graph/badge.svg?token=zYiAqd9aFz" />
</a>
<a href='https://gitee.com/yadong.zhang/JustAuth/stargazers'>
<img src='https://gitee.com/yadong.zhang/JustAuth/badge/star.svg?theme=gvp' alt='star'></img>
</a>
<a target="_blank" href='https://github.com/zhangyd-c/JustAuth'>
<img src="https://img.shields.io/github/stars/zhangyd-c/JustAuth.svg?style=social" alt="github star"></img>
</a>
</p>
<center>
<table>
<tr>
<td align="center" width="200"><a href="#授权gitee"><img src="https://gitee.com/logo_icon.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权github"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/github.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权weibo"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/weibo.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权钉钉"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/dingding.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权百度"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/baidu.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权coding"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/coding.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权腾讯云开发者平台"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/tencent_cloud.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权oschina"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/oschinas.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权支付宝"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/alipay.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权qq"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/qq.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权微信"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/wechats.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权淘宝"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/taobao.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权google"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/google.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权facebook"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/facebook.png" width="20"></a></td>
<td align="center" width="200"><a href="#授权csdn"><img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/csdn.png" width="20"></a></td>
</tr>
</table>
</center>
-------------------------------------------------------------------------------
<p align="center">
<img src='./docs/media/75a3c076.png' alt='star'></img>
</p>
-------------------------------------------------------------------------------
QQ 群230017570
微信群justauth (备注`justauth`或者`ja`
帮助文档:[www.justauth.cn](https://www.justauth.cn)
## 什么是 JustAuth
JustAuth如你所见它仅仅是一个**第三方授权登录**的**工具类库**它可以让我们脱离繁琐的第三方登录SDK让登录变得**So easy!**
JustAuth如你所见它仅仅是一个**第三方授权登录**的**工具类库**,它可以让我们脱离繁琐的第三方登录 SDK让登录变得**So easy!**
项目开源地址:[gitee](https://gitee.com/yadong.zhang/JustAuth) | [github](https://github.com/zhangyd-c/JustAuth)
JustAuth 集成了诸如Github、Gitee、支付宝、新浪微博、微信、Google、Facebook、Twitter、StackOverflow等国内外数十家第三方平台。更多请参考<a href="https://www.justauth.cn" target="_blank">已集成的平台</a>
## 有哪些特点?
1. **全**:已集成十多家第三方平台(国内外常用的基本都已包含),仍然还在持续扩展中([开发计划](https://gitee.com/yadong.zhang/JustAuth/issues/IUGRK)
2. **简**API就是奔着最简单去设计的见后面`快速开始`),尽量让您用起来没有障碍感!
## 有哪些功能?
- 集成国内外数十家第三方平台,实现快速接入。<a href="https://www.justauth.cn/guide/" target="_blank">参考文档</a>
- 自定义 State 缓存,支持各种分布式缓存组件。<a href="https://www.justauth.cn/features/using-state/" target="_blank">参考文档</a>
- 自定义 OAuth 平台,更容易适配自有的 OAuth 服务。<a href="https://www.justauth.cn/features/customize-the-oauth/" target="_blank">参考文档</a>
- 自定义 Http 实现,选择权完全交给开发者,不会单独依赖某一具体实现。<a href="https://www.justauth.cn/guide/quickstart/how-to-use/#%E4%BD%BF%E7%94%A8%E6%AD%A5%E9%AA%A4" target="_blank">参考文档</a>
- 自定义 Scope支持更完善的授权体系。<a href="https://www.justauth.cn/features/customize-scopes/#%E5%85%B3%E4%BA%8E-scope" target="_blank">参考文档</a>
- 更多...<a href="https://www.justauth.cn" target="_blank">参考文档</a>
## 快速开始
- 引入依赖
### 引入依赖
```xml
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>1.3.2</version>
<version>{latest-version}</version>
</dependency>
```
- 调用api
> **latest-version** 可选:
> - 稳定版:![](https://img.shields.io/github/v/release/justauth/JustAuth?style=flat-square)
> - 快照版:![](https://img.shields.io/nexus/s/https/oss.sonatype.org/me.zhyd.oauth/JustAuth.svg?style=flat-square)
> > 注意:快照版本是功能的尝鲜,并不保证稳定性。请勿在生产环境中使用。
>
> <details>
> <summary>如何引入快照版本</summary>
>
> JustAuth 的快照版本托管在 ossrh 上,所以要指定下载地址。
>
> ```xml
> <repositories>
> <repository>
> <id>ossrh-snapshot</id>
> <url>https://oss.sonatype.org/content/repositories/snapshots</url>
> <snapshots>
> <enabled>true</enabled>
> </snapshots>
> </repository>
> </repositories>
> ```
>
> 如果你想第一时间获取 JustAuth 的最新快照,可以添加下列代码,每次构建时都检查是否有最新的快照(默认每天检查)。
>
> ```diff
> <url>https://oss.sonatype.org/content/repositories/snapshots</url>
> <snapshots>
> + <updatePolicy>always</updatePolicy>
> <enabled>true</enabled>
> </snapshots>
> ```
>
> </details>
如下**任选一种** HTTP 工具 依赖_项目内如果已有请忽略。另外需要特别注意如果项目中已经引入了低版本的依赖请先排除低版本依赖后再引入高版本或者最新版本的依赖_
- hutool-http
```xml
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
<version>5.7.7</version>
</dependency>
```
- httpclient
```xml
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
```
- okhttp
```xml
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.1</version>
</dependency>
```
### 调用api
#### 普通方式
```java
// 创建授权request
AuthRequest authRequest = new AuthGiteeRequest(AuthConfig.builder()
@ -64,139 +151,119 @@ AuthRequest authRequest = new AuthGiteeRequest(AuthConfig.builder()
.redirectUri("redirectUri")
.build());
// 生成授权页面
authRequest.authorize();
// 授权登录后会返回一个code用这个code进行登录
authRequest.login("code");
authRequest.authorize("state");
// 授权登录后会返回codeauth_code仅限支付宝、state1.8.0版本后可以用AuthCallback类作为回调接口的参数
// 注JustAuth默认保存state的时效为3分钟3分钟内未使用则会自动清除过期的state
authRequest.login(callback);
```
**配套Demo**[JustAuth-demo](https://gitee.com/yadong.zhang/JustAuth-demo)
#### Builder 方式一
具体的例子可以参考:
静态配置 `AuthConfig`
- [实现Gitee授权登录](http://t.cn/ExDKxQs)
- [实现Github授权登录](http://t.cn/EJ0Fxqo)
```java
AuthRequest authRequest = AuthRequestBuilder.builder()
.source("github")
.authConfig(AuthConfig.builder()
.clientId("clientId")
.clientSecret("clientSecret")
.redirectUri("redirectUri")
.build())
.build();
// 生成授权页面
authRequest.authorize("state");
// 授权登录后会返回codeauth_code仅限支付宝、state1.8.0版本后可以用AuthCallback类作为回调接口的参数
// 注JustAuth默认保存state的时效为3分钟3分钟内未使用则会自动清除过期的state
authRequest.login(callback);
```
#### API列表
| :computer: 平台 | :coffee: API类 | :page_facing_up: SDK |
|:------:|:-------:|:-------:|
| <img src="https://gitee.com/logo_icon.png" width="20"> | [AuthGiteeRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthGiteeRequest.java) | <a href="https://gitee.com/api/v5/oauth_doc#list_1" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/github.png" width="20"> | [AuthGithubRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthGiteeRequest.java) | <a href="https://github.com/settings/developers" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/weibo.png" width="20"> | [AuthWeiboRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthGiteeRequest.java) | <a href="https://open.weibo.com/wiki/%E5%BE%AE%E5%8D%9AAPI" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/dingding.png" width="20"> | [AuthDingTalkRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthDingTalkRequest.java) | <a href="https://open-doc.dingtalk.com/microapp/serverapi2/kymkv6" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/baidu.png" width="20"> | [AuthBaiduRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthBaiduRequest.java) | <a href="https://developer.baidu.com/" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/coding.png" width="25"> | [AuthCodingRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthCodingRequest.java) | <a href="https://open.coding.net/references/oauth/" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/tencent_cloud.png" width="25"> | [AuthTencentCloudRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthTencentCloudRequest.java) | <a href="https://dev.tencent.com/help/doc/faq/b4e5b7aee786/oauth" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/oschinas.png" width="20"> | [AuthOschinaRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthOschinaRequest.java) | <a href="https://www.oschina.net/openapi/docs/openapi_user" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/alipay.png" width="20"> | [AuthAlipayRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthAlipayRequest.java) | <a href="https://alipay.open.taobao.com/docs/doc.htm?spm=a219a.7629140.0.0.336d4b70GUKXOl&treeId=193&articleId=105809&docType=1" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/qq.png" width="20"> | [AuthQqRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthQqRequest.java) | <a href="http://wiki.connect.qq.com/" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/wechats.png" width="20"> | [AuthWeChatRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthWeChatRequest.java) | <a href="https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419316505&token=&lang=zh_CN" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/taobao.png" width="20"> | [AuthTaobaoRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthTaobaoRequest.java) | <a href="https://open.taobao.com/doc.htm?spm=a219a.7386797.0.0.4e00669acnkQy6&source=search&docId=105590&docType=1" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/google.png" width="20"> | [AuthGoogleRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthGoogleRequest.java) | <a href="https://developers.google.com/identity/protocols/OpenIDConnect" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/facebook.png" width="20"> | [AuthFacebookRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthFacebookRequest.java) | <a href="https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow" target="_blank">参考文档</a> |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/JustAuth/csdn.png" width="20"> | [AuthCsdnRequest](https://gitee.com/yadong.zhang/JustAuth/blob/master/src/main/java/me/zhyd/oauth/request/AuthCsdnRequest.java) | 无 |
#### Builder 方式二
_请知悉经咨询CSDN官方客服得知CSDN的授权开放平台已经下线。如果以前申请过的应用可以继续使用但是不再支持申请新的应用。so, 本项目中的CSDN登录只能针对少部分用户使用了_
动态获取并配置 `AuthConfig`
## 后续开发计划
```java
AuthRequest authRequest = AuthRequestBuilder.builder()
.source("gitee")
.authConfig((source) -> {
// 通过 source 动态获取 AuthConfig
// 此处可以灵活的从 sql 中取配置也可以从配置文件中取配置
return AuthConfig.builder()
.clientId("clientId")
.clientSecret("clientSecret")
.redirectUri("redirectUri")
.build();
})
.build();
Assert.assertTrue(authRequest instanceof AuthGiteeRequest);
System.out.println(authRequest.authorize(AuthStateUtils.createState()));
```
参考:[[开发计划] 待扩展的第三方平台](https://gitee.com/yadong.zhang/JustAuth/issues/IUGRK)
#### Builder 方式支持自定义的平台
另外,期待您和我一起完善这个项目!
```java
AuthRequest authRequest = AuthRequestBuilder.builder()
// 关键点:将自定义实现的 AuthSource 配置上
.extendSource(AuthExtendSource.values())
// source 对应 AuthExtendSource 中的枚举 name
.source("other")
// ... 其他内容不变,参考上面的示例
.build();
```
## 贡献代码
## 赞助和支持
1. fork本项目到自己的repo
2. 把fork过去的项目也就是你仓库中的项目clone到你的本地
3. 修改代码
4. commit后push到自己的库
5. 发起PRpull request 请求
6. 等待作者合并
感谢以下赞助商的支持:
## 致谢
[我要赞助](https://www.justauth.cn/sponsor.html)
在项目立项初期,也对当前开源圈的一些相同类型的项目作过调研,同时本项目也参考过这些项目,再次感谢开源圈内的朋友。
## JustAuth 的用户
有很多公司、组织和个人把 JustAuth 用于学习、研究、生产环境和商业产品中,包括(但不限于):
[YurunOAuthLogin](https://gitee.com/yurunsoft/YurunOAuthLogin): PHP 第三方登录授权 SDK
[![](docs/users/col.png)](https://www.mochiwang.com "给作者提供云写作的一个工具")![](docs/users/bjgyol.png)![](docs/users/foresealife.png)![](docs/users/sevnce.png)
![](docs/users/bladex.png)![](docs/users/gun.png)![](docs/users/sika.jpg)![](docs/users/maxkey.png)![](docs/users/shiroaction.png)![](docs/users/xkcoding.png)
## 参考授权图例
#### 授权gitee
怎么没有我?[登记](https://gitee.com/yadong.zhang/JustAuth/issues/IZ2T7)
![Gitee授权登录](https://images.gitee.com/uploads/images/2019/0221/140015_4c09610e_784199.png "Gitee授权登录")
## 开源推荐
#### 授权github
- `JAP` 开源的登录认证中间件: [https://gitee.com/fujieid/jap](https://gitee.com/fujieid/jap)
- `spring-boot-demo` 深度学习并实战 spring boot 的项目: [https://github.com/xkcoding/spring-boot-demo](https://github.com/xkcoding/spring-boot-demo)
- `mica` SpringBoot 微服务高效开发工具集: [https://github.com/lets-mica/mica](https://github.com/lets-mica/mica)
- `sureness` 面向restful api的高性能认证鉴权框架[sureness](https://github.com/usthe/sureness)
更多推荐,请参考:[JustAuth - 开源推荐](https://www.justauth.cn)
![Github授权登录](https://images.gitee.com/uploads/images/2019/0221/140032_58f7dfb5_784199.png "Github授权登录")
## 鸣谢
#### 授权weibo
- 感谢 JetBrains 提供的免费开源 License
![微博授权登录](https://images.gitee.com/uploads/images/2019/0222/191210_67d5597c_784199.png "微博授权登录")
<p>
<img src="https://images.gitee.com/uploads/images/2020/0406/220236_f5275c90_5531506.png" alt="图片引用自lets-mica" style="float:left;">
</p>
#### 授权钉钉
## 其他
![钉钉授权登录](https://images.gitee.com/uploads/images/2019/0221/140540_8da8d959_784199.jpeg "钉钉授权登录")
- [CONTRIBUTORS](https://www.justauth.cn/contributors.html)
- [CHANGELOGS](https://www.justauth.cn/update.html)
- [PLAN](https://gitee.com/yadong.zhang/JustAuth/issues/IUGRK)
#### 授权百度
## 贡献者列表
![百度授权登录](https://images.gitee.com/uploads/images/2019/0221/140607_ebf1dcb6_784199.png "百度授权登录")
[![contributors](https://whnb.wang/contributors/yadong.zhang/JustAuth)](https://whnb.wang)
#### 授权coding
## Stars 趋势
![Coding授权登录](https://images.gitee.com/uploads/images/2019/0224/192106_fd53b3d7_784199.png "Coding授权登录")
### Gitee
#### 授权腾讯云开发者平台
[![Stargazers over time](https://whnb.wang/img/yadong.zhang/JustAuth?e=604800)](https://whnb.wang/yadong.zhang/JustAuth?e=604800)
![腾讯云开发者平台授权登录](https://images.gitee.com/uploads/images/2019/0224/192128_db9e203b_784199.png "腾讯云开发者平台授权登录")
### Github
#### 授权oschina
[![Stargazers over time](https://starchart.cc/justauth/JustAuth.svg)](https://starchart.cc/justauth/JustAuth)
![授权oschina登录](https://images.gitee.com/uploads/images/2019/0322/230652_05b4fd8a_784199.png "授权oschina")
### ProductHunt
#### 授权支付宝
![授权支付宝登录](https://images.gitee.com/uploads/images/2019/0327/183654_3d4b94eb_784199.png "授权支付宝登录")
#### 授权qq
待续
#### 授权微信
![授权微信登录](https://images.gitee.com/uploads/images/2019/0523/104955_d4cea750_784199.png "授权微信登录")
#### 授权淘宝
![授权淘宝登录](https://images.gitee.com/uploads/images/2019/0518/154604_68b38305_784199.png "授权淘宝登录")
#### 授权Google
![授权google登录](https://images.gitee.com/uploads/images/2019/0521/190650_85c5f1c7_784199.png "授权google登录")
#### 授权Facebook
![授权facebook登录](https://images.gitee.com/uploads/images/2019/0521/233647_6a89fb45_784199.png "授权facebook登录")
#### 授权csdn
_请知悉经咨询CSDN官方客服得知CSDN的授权开放平台已经下线。如果以前申请过的应用可以继续使用但是不再支持申请新的应用。so, 本项目中的CSDN登录只能针对少部分用户使用了_
## 关注&交流
| 公众号 | 微信(备注:加群) |
| :------------: | :------------: |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/wx/wechat_account.jpg" width="200" /> | <img src="https://gitee.com/yadong.zhang/static/raw/master/wx/wx.png" width="170"/> |
**QQ群**
- JustAuth交流群 230017570专业交流该项目
- 开源总群 190886500各个开源项目的都有也有博客建设等方面的朋友。注意该群需付费进入防止发垃圾广告、垃圾推广等人士
## 请喝咖啡
| 支付宝 | 微信 |
| :------------: | :------------: |
| <img src="https://gitee.com/yadong.zhang/static/raw/master/qrcode/zfb_code.png" width="200"/> | <img src="https://gitee.com/yadong.zhang/static/raw/master/qrcode/wx_code.png" width="200" /> |
<a href="https://www.producthunt.com/posts/justauth?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-justauth" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=196886&theme=dark" alt="JustAuth - Login, so easy! | Product Hunt Embed" style="width: 250px; height: 54px;" width="250px" height="54px" /></a>

1
bin/pull-dev.sh Normal file
View File

@ -0,0 +1 @@
git pull origin dev && git pull github dev

1
bin/pull.sh Normal file
View File

@ -0,0 +1 @@
git pull origin master && git pull github master

1
bin/push-dev.sh Normal file
View File

@ -0,0 +1 @@
git push origin dev && git push github dev

1
bin/push.sh Normal file
View File

@ -0,0 +1 @@
git push origin master && git push github master

33
bin/repVersion.sh Normal file
View File

@ -0,0 +1,33 @@
#!/bin/bash
#-----------------------------------------------------------
# 参考自 hutool 工具
# 此脚本用于每次升级justauth时替换相应位置的版本号
#-----------------------------------------------------------
pwd=$(pwd)
echo "当前路径:$pwd"
if [ -n "$1" ];then
new_version="$1"
old_version=`cat $pwd/bin/version.txt`
echo "$old_version 替换为新版本 $new_version"
else
# 参数错误,退出
echo "ERROR: 请指定新版本!"
exit
fi
if [ ! -n "$old_version" ]; then
echo "ERROR: 旧版本不存在请确认bin/version.txt中信息正确"
exit
fi
# 替换README.md等文件中的版本
sed -i "s/${old_version}/${new_version}/g" $pwd/README.md
sed -i "s/${old_version}/${new_version}/g" $pwd/README.en-US.md
# 替换pom.xml中的版本
sed -i "s/${old_version}/${new_version}/g" $pwd/pom.xml
# 保留新版本号
echo "$new_version" > $pwd/bin/version.txt

19
bin/updVersion.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
#------------------------------------------------
# 参考自 hutool 工具
# 升级justauth版本包括
# 1. 升级pom.xml中的版本号
# 2. 替换README.md中的版本号
#------------------------------------------------
if [ ! -n "$1" ]; then
echo "ERROR: 新版本不存在请指定参数1"
exit
fi
# 替换所有模块pom.xml中的版本
mvn versions:set -DnewVersion=$1
# 替换其它地方的版本
source $(pwd)/bin/repVersion.sh "$1"

1
bin/version.txt Normal file
View File

@ -0,0 +1 @@
1.16.7

0
docs/.nojekyll Normal file
View File

22
docs/index.html Normal file
View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="google-site-verification" content="DJSx-fAGWci-EWueWy2_RfafHJX1iv5XhfftGSg-SR0" />
<meta charset="UTF-8">
<title>JustAuth - 史上最全的整合第三方登录的开源库</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta name="description" content="JustAuth史上最全的整合第三方登录的开源库" />
<meta name="keywords" content="JustAuth,第三方授权登录,OAuth" />
<meta itemprop="name" content="JustAuth,史上最全的整合第三方登录的开源库" />
<meta itemprop="description" content="JustAuth如你所见它仅仅是一个第三方授权登录的工具类库它可以让我们脱离繁琐的第三方登录SDK让登录变得So easy!" />
</head>
<body>
<script>
window.location.href = "https://www.justauth.cn";
</script>
</body>
</html>

BIN
docs/media/75a3c076.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
docs/users/bjgyol.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
docs/users/bladex.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
docs/users/col.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
docs/users/foresealife.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
docs/users/gun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
docs/users/maxkey.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
docs/users/sevnce.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
docs/users/shiroaction.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
docs/users/sika.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
docs/users/xkcoding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

111
example.md Normal file
View File

@ -0,0 +1,111 @@
## 各平台授权页面示例
_注非全部平台部分平台可能不存在图例_
#### 授权gitee
![Gitee授权登录](https://images.gitee.com/uploads/images/2019/0221/140015_4c09610e_784199.png "Gitee授权登录")
#### 授权github
![Github授权登录](https://images.gitee.com/uploads/images/2019/0221/140032_58f7dfb5_784199.png "Github授权登录")
#### 授权weibo
![微博授权登录](https://images.gitee.com/uploads/images/2019/0222/191210_67d5597c_784199.png "微博授权登录")
#### 授权钉钉
![钉钉授权登录](https://images.gitee.com/uploads/images/2019/0221/140540_8da8d959_784199.jpeg "钉钉授权登录")
#### 授权百度
![百度授权登录](https://images.gitee.com/uploads/images/2019/0221/140607_ebf1dcb6_784199.png "百度授权登录")
#### 授权coding
![Coding授权登录](https://images.gitee.com/uploads/images/2019/0224/192106_fd53b3d7_784199.png "Coding授权登录")
#### 授权腾讯云开发者平台
![腾讯云开发者平台授权登录](https://images.gitee.com/uploads/images/2019/0224/192128_db9e203b_784199.png "腾讯云开发者平台授权登录")
#### 授权oschina
![授权oschina登录](https://images.gitee.com/uploads/images/2019/0322/230652_05b4fd8a_784199.png "授权oschina")
#### 授权支付宝
![授权支付宝登录](https://images.gitee.com/uploads/images/2019/0327/183654_3d4b94eb_784199.png "授权支付宝登录")
#### 授权qq
暂无
#### 授权微信
![授权微信登录](https://images.gitee.com/uploads/images/2019/0523/104955_d4cea750_784199.png "授权微信登录")
#### 授权淘宝
![授权淘宝登录](https://images.gitee.com/uploads/images/2019/0518/154604_68b38305_784199.png "授权淘宝登录")
#### 授权Google
![授权google登录](https://images.gitee.com/uploads/images/2019/0521/190650_85c5f1c7_784199.png "授权google登录")
#### 授权Facebook
![授权facebook登录](https://images.gitee.com/uploads/images/2019/0521/233647_6a89fb45_784199.png "授权facebook登录")
#### 授权抖音
暂无
#### 授权领英
![授权领英登录](https://images.gitee.com/uploads/images/2019/0527/152207_a6342979_784199.png "授权领英登录")
#### 授权微软
![授权微软](https://images.gitee.com/uploads/images/2019/0718/224146_681aa535_784199.png "授权微软")
#### 授权小米
暂无
#### 授权今日头条
暂无
#### 授权Teambition
![授权Teambition](https://images.gitee.com/uploads/images/2019/0718/224119_3da514ab_784199.png "授权Teambition")
#### 授权Pinterest
![授权Pinterest](https://images.gitee.com/uploads/images/2019/0718/155012_6290f500_784199.jpeg "授权Pinterest")
#### 授权Renren
![授权Renre](https://images.gitee.com/uploads/images/2019/0718/155035_8e26c10a_784199.jpeg "授权Renren")
#### 授权Stack Overflow
![授权Stack Overflow](https://images.gitee.com/uploads/images/2019/0718/192639_cc301ba7_784199.png "授权Stack Overflow")
#### 授权afdian
![授权afdian](https://img.fastmirror.net/s/2023/03/24/641d63a8c19b5.png "授权afDian")
#### 授权Twitter
![授权Twitter]( "授权Twitter")
#### 授权csdn
暂无
_请知悉经咨询CSDN官方客服得知CSDN的授权开放平台已经下线。如果以前申请过的应用可以继续使用但是不再支持申请新的应用。so, 本项目中的CSDN登录只能针对少部分用户使用了_

35
ja.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/bash
# 参考自 hutool 工具
help(){
echo "--------------------------------------------------------------------------"
echo ""
echo "usage: ./ja.sh [updv]"
echo ""
echo "-updv [version num] Update all justauth related versions."
echo ""
echo "--------------------------------------------------------------------------"
}
case "$1" in
'updv')
bin/updVersion.sh $2
;;
'ppd')
bin/pull-dev.sh
;;
'pp')
bin/pull.sh
;;
'pd')
bin/push-dev.sh
;;
'p')
bin/push.sh
;;
'd')
bin/deploy.sh
;;
*)
help
esac

466
pom.xml
View File

@ -2,191 +2,313 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>1.3.3</version>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>1.16.7</version>
<name>JustAuth</name>
<name>JustAuth</name>
<url>https://gitee.com/yadong.zhang/JustAuth</url>
<description>
小而全而美的第三方登录开源组件。目前已支持Github、Gitee、微博、钉钉、百度、Coding、腾讯云开发者平台、OSChina、支付宝、QQ、微信、淘宝、Google、Facebook、抖音、领英、小米、微软、今日头条、Teambition、StackOverflow、Pinterest、人人、华为、企业微信、酷家乐、Gitlab、美团、饿了么、推特、飞书、京东、阿里云、喜马拉雅、Amazon、Slack和Line等第三方平台的授权登录。 Login, so easy!
</description>
<licenses>
<license>
<name>MIT</name>
<url>https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE</url>
</license>
</licenses>
<scm>
<connection>scm:git:https://gitee.com/yadong.zhang/JustAuth.git</connection>
<developerConnection>scm:git:https://gitee.com/yadong.zhang/JustAuth.git</developerConnection>
<url>https://gitee.com/yadong.zhang/JustAuth</url>
<description>史上最全的整合第三方登录的工具, Just Auth</description>
</scm>
<licenses>
<license>
<name>MIT</name>
<url>https://gitee.com/yadong.zhang/JustAuth/blob/master/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<name>Yadong.Zhang</name>
<email>yadong.zhang0415@gmail.com</email>
<url>https://www.zhyd.me</url>
</developer>
<developer>
<name>Yangkai.Shen</name>
<email>shenyangkai1994@gmail.com</email>
<url>https://xkcoding.com</url>
</developer>
<developer>
<name>Hongwei.Peng</name>
<email>pengisgood@gmail.com</email>
<url>https://github.com/pengisgood</url>
</developer>
</developers>
<scm>
<connection>scm:git:https://gitee.com/yadong.zhang/JustAuth.git</connection>
<developerConnection>scm:git:https://gitee.com/yadong.zhang/JustAuth.git</developerConnection>
<url>https://gitee.com/yadong.zhang/JustAuth</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven-source.version>2.2.1</maven-source.version>
<maven-compiler.version>3.8.1</maven-compiler.version>
<maven-javadoc.version>2.9.1</maven-javadoc.version>
<cobertura-version>2.7</cobertura-version>
<maven-surefire-version>2.20</maven-surefire-version>
<maven-gpg-version>1.6</maven-gpg-version>
<maven.test.skip>false</maven.test.skip>
<simple-http.version>1.0.5</simple-http.version>
<lombok-version>1.18.30</lombok-version>
<junit-version>4.13.2</junit-version>
<fastjson-version>1.2.83</fastjson-version>
<alipay-sdk-version>4.39.165.ALL</alipay-sdk-version>
<jacoco-version>0.8.2</jacoco-version>
<jwt.version>0.12.3</jwt.version>
<bcpkix-jdk18on.version>1.78</bcpkix-jdk18on.version>
</properties>
<developers>
<developer>
<name>yadong.zhang</name>
<email>yadong.zhang0415@gmail.com</email>
<url>https://www.zhyd.me</url>
</developer>
<developer>
<name>Yangkai.Shen</name>
<email>shenyangkai1994@gmail.com</email>
<url>https://xkcoding.com</url>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok-version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.xkcoding.http</groupId>
<artifactId>simple-http</artifactId>
<version>${simple-http.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson-version}</version>
</dependency>
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>${alipay-sdk-version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>fastjson</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>${jwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>${jwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>${jwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>${bcpkix-jdk18on.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven-source.version>2.2.1</maven-source.version>
<maven-compiler.version>3.7.0</maven-compiler.version>
<maven.test.skip>true</maven.test.skip>
<hutool-version>4.1.21</hutool-version>
<lombok-version>1.18.4</lombok-version>
<junit-version>4.11</junit-version>
<fastjson-version>1.2.44</fastjson-version>
<google-api-version>1.28.0</google-api-version>
<guava-version>27.1-jre</guava-version>
<alipay-sdk-version>3.7.4.ALL</alipay-sdk-version>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok-version}</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-http</artifactId>
<version>${hutool-version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson-version}</version>
</dependency>
<!--<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>${google-api-version}</version>
</dependency>-->
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>${alipay-sdk-version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<build>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler.version}</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source.version}</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<additionalparam>${javadoc.opts}</additionalparam>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-version}</version>
<configuration>
<!-- 包含其他测试类 -->
<includes>
<include>**/*Test.java</include>
</includes>
<!-- 排除掉AuthRequestTest测试类该类只做api演示用 -->
<excludes>
<exclude>**/AuthRequestTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>snapshot</id>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler.version}</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source.version}</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source.version}</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${cobertura-version}</version>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<check/>
</configuration>
</plugin>
<!-- Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-version}</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- GPG -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-version}</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<!-- Source -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source.version}</version>
<inherited>true</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- GPG -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>
</plugins>
</build>
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
<!--私服-->
<profile>
<id>nexus</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-version}</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>xkcoding-nexus</id>
<url>https://nexus.xkcoding.com/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>xkcoding-nexus</id>
<url>https://nexus.xkcoding.com/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</profile>
<!-- 禁用 Javadoc 注释检查 -->
<profile>
<id>disable-javadoc-doclint</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<javadoc.opts>-Xdoclint:none</javadoc.opts>
</properties>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,101 @@
package me.zhyd.oauth;
import me.zhyd.oauth.cache.AuthStateCache;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.config.AuthDefaultSource;
import me.zhyd.oauth.config.AuthSource;
import me.zhyd.oauth.enums.AuthResponseStatus;
import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.request.AuthDefaultRequest;
import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.StringUtils;
import java.util.Arrays;
import java.util.function.Function;
/**
* 快捷的构建 AuthRequest
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @author ngcly
* @version 1.0.0
* @since 1.16.3
*/
public class AuthRequestBuilder {
private String source;
private AuthConfig authConfig;
private AuthStateCache authStateCache;
private AuthSource[] extendSource;
private AuthRequestBuilder() {
}
public static AuthRequestBuilder builder() {
return new AuthRequestBuilder();
}
public AuthRequestBuilder source(String source) {
this.source = source;
return this;
}
public AuthRequestBuilder authConfig(AuthConfig authConfig) {
this.authConfig = authConfig;
return this;
}
public AuthRequestBuilder authConfig(Function<String, AuthConfig> authConfig) {
this.authConfig = authConfig.apply(this.source);
return this;
}
public AuthRequestBuilder authStateCache(AuthStateCache authStateCache) {
this.authStateCache = authStateCache;
return this;
}
public AuthRequestBuilder extendSource(AuthSource... extendSource) {
this.extendSource = extendSource;
return this;
}
public AuthRequest build() {
if (StringUtils.isEmpty(this.source) || null == this.authConfig) {
throw new AuthException(AuthResponseStatus.NOT_IMPLEMENTED);
}
// 合并 JustAuth 默认的 AuthDefaultSource 开发者自定义的 AuthSource
AuthSource[] sources = this.concat(AuthDefaultSource.values(), extendSource);
// 筛选符合条件的 AuthSource
AuthSource source = Arrays.stream(sources).distinct()
.filter(authSource -> authSource.getName().equalsIgnoreCase(this.source))
.findAny()
.orElseThrow(() -> new AuthException(AuthResponseStatus.NOT_IMPLEMENTED));
Class<? extends AuthDefaultRequest> targetClass = source.getTargetClass();
if (null == targetClass) {
throw new AuthException(AuthResponseStatus.NOT_IMPLEMENTED);
}
try {
if (this.authStateCache == null) {
return targetClass.getDeclaredConstructor(AuthConfig.class).newInstance(this.authConfig);
} else {
return targetClass.getDeclaredConstructor(AuthConfig.class, AuthStateCache.class).newInstance(this.authConfig, this.authStateCache);
}
} catch (Exception e) {
e.printStackTrace();
throw new AuthException(AuthResponseStatus.NOT_IMPLEMENTED);
}
}
private AuthSource[] concat(AuthSource[] first, AuthSource[] second) {
if (null == second || second.length == 0) {
return first;
}
AuthSource[] result = new AuthSource[first.length + second.length];
System.arraycopy(first, 0, result, 0, first.length);
System.arraycopy(second, 0, result, first.length, second.length);
return result;
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 支付宝授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class AlipayAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getAlipayAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,15 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
/**
* 授权接口用来获取具体第三方平台的授权地址
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public interface Authorization {
String getAuthorizeUrl(AuthConfig config);
}

View File

@ -1,76 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthSource;
import me.zhyd.oauth.request.ResponseStatus;
import java.util.HashMap;
import java.util.Map;
/**
* 授权工厂类负责创建指定平台的授权类获取授权地址
* <p>
* 使用策略模式 + 工厂模式 避免大量的if elseswatch操作
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class AuthorizationFactory {
private static Map<String, Authorization> authorizationMap = new HashMap<>();
private static boolean loader = false;
private AuthorizationFactory() {
}
/**
* 根据第三方平台获取具体的授权工具
*
* @param source 平台
* @return 具体的Authorization
*/
public static Authorization getAuthorize(AuthSource source) {
if (null == source) {
throw new AuthException(ResponseStatus.NO_AUTH_SOURCE);
}
registerAllAuthorize();
Authorization authorization = authorizationMap.get(source.toString());
if (null == authorization) {
throw new AuthException(ResponseStatus.UNIDENTIFIED_PLATFORM);
}
return authorization;
}
/**
* 将所有Authorize的实现类注册到authorizeMap中
* 每次增加新的平台都需要在这儿添加注册代码
*/
private static void registerAllAuthorize() {
if (loader) {
return;
}
AuthorizationFactory.register(AuthSource.ALIPAY, new AlipayAuthorization());
AuthorizationFactory.register(AuthSource.BAIDU, new BaiduAuthorization());
AuthorizationFactory.register(AuthSource.CODING, new CodingAuthorization());
AuthorizationFactory.register(AuthSource.CSDN, new CsdnAuthorization());
AuthorizationFactory.register(AuthSource.DINGTALK, new DingTalkAuthorization());
AuthorizationFactory.register(AuthSource.GITEE, new GiteeAuthorization());
AuthorizationFactory.register(AuthSource.GITHUB, new GithubAuthorization());
AuthorizationFactory.register(AuthSource.GOOGLE, new GoogleAuthorization());
AuthorizationFactory.register(AuthSource.OSCHINA, new OschinaAuthorization());
AuthorizationFactory.register(AuthSource.QQ, new QqAuthorization());
AuthorizationFactory.register(AuthSource.TAOBAO, new TaobaoAuthorization());
AuthorizationFactory.register(AuthSource.TENCEN_CLOUD, new TencentCloudAuthorization());
AuthorizationFactory.register(AuthSource.WECHAT, new WeChatAuthorization());
AuthorizationFactory.register(AuthSource.WEIBO, new WeiboAuthorization());
AuthorizationFactory.register(AuthSource.FACEBOOK, new FacebookAuthorization());
loader = true;
}
private static void register(AuthSource authSource, Authorization authorization) {
authorizationMap.put(authSource.toString(), authorization);
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 百度授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class BaiduAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getBaiduAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* Coding授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class CodingAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getCodingAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* CSDN授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class CsdnAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getCsdnAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 钉钉授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class DingTalkAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getDingTalkQrConnectUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* Facebook授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.3
* @since 1.3
*/
public class FacebookAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getFacebookAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 码云授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class GiteeAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getGiteeAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* Github授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class GithubAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getGithubAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* Google授权
*
* @author yangkai.shen (https://xkcoding.com)
* @version 1.3
* @since 1.3
*/
public class GoogleAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getGoogleAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 开源中国授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class OschinaAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getOschinaAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* QQ授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class QqAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getQqAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 淘宝授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class TaobaoAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getTaobaoAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 腾讯云授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class TencentCloudAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getTencentCloudAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 微信授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class WeChatAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getWeChatAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -1,19 +0,0 @@
package me.zhyd.oauth.authorization;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 微博授权
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
public class WeiboAuthorization implements Authorization {
@Override
public String getAuthorizeUrl(AuthConfig config) {
return UrlBuilder.getWeiboAuthorizeUrl(config.getClientId(), config.getRedirectUri());
}
}

View File

@ -0,0 +1,50 @@
package me.zhyd.oauth.cache;
/**
* JustAuth缓存用来缓存State
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.9.3
*/
public interface AuthCache {
/**
* 设置缓存
*
* @param key 缓存KEY
* @param value 缓存内容
*/
void set(String key, String value);
/**
* 设置缓存指定过期时间
*
* @param key 缓存KEY
* @param value 缓存内容
* @param timeout 指定缓存过期时间毫秒
*/
void set(String key, String value, long timeout);
/**
* 获取缓存
*
* @param key 缓存KEY
* @return 缓存内容
*/
String get(String key);
/**
* 是否存在key如果对应key的value值已过期也返回false
*
* @param key 缓存KEY
* @return true存在key并且value没过期falsekey不存在或者已过期
*/
boolean containsKey(String key);
/**
* 清理过期的缓存
*/
default void pruneCache() {
}
}

View File

@ -0,0 +1,22 @@
package me.zhyd.oauth.cache;
/**
* AuthCache配置类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.10.0
*/
public class AuthCacheConfig {
/**
* 默认缓存过期时间3分钟
* 鉴于授权过程中根据个人的操作习惯或者授权平台的不同google等每个授权流程的耗时也有差异不过单个授权流程一般不会太长
* 本缓存工具默认的过期时间设置为3分钟即程序默认认为3分钟内的授权有效超过3分钟则默认失效失效后删除
*/
public static long timeout = 3 * 60 * 1000;
/**
* 是否开启定时{@link AuthDefaultCache#pruneCache()}的任务
*/
public static boolean schedulePrune = true;
}

View File

@ -0,0 +1,42 @@
package me.zhyd.oauth.cache;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 缓存调度器
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.9.3
*/
public enum AuthCacheScheduler {
/**
* 当前实例
*/
INSTANCE;
private AtomicInteger cacheTaskNumber = new AtomicInteger(1);
private ScheduledExecutorService scheduler;
AuthCacheScheduler() {
create();
}
private void create() {
this.shutdown();
this.scheduler = new ScheduledThreadPoolExecutor(10, r -> new Thread(r, String.format("JustAuth-Task-%s", cacheTaskNumber.getAndIncrement())));
}
public void shutdown() {
if (null != scheduler) {
this.scheduler.shutdown();
}
}
public void schedule(Runnable task, long delay) {
this.scheduler.scheduleAtFixedRate(task, delay, delay, TimeUnit.MILLISECONDS);
}
}

View File

@ -0,0 +1,140 @@
package me.zhyd.oauth.cache;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* 默认的缓存实现
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.9.3
*/
public class AuthDefaultCache implements AuthCache {
/**
* state cache
*/
private static Map<String, CacheState> stateCache = new ConcurrentHashMap<>();
private final ReentrantReadWriteLock cacheLock = new ReentrantReadWriteLock(true);
private final Lock writeLock = cacheLock.writeLock();
private final Lock readLock = cacheLock.readLock();
public AuthDefaultCache() {
if (AuthCacheConfig.schedulePrune) {
this.schedulePrune(AuthCacheConfig.timeout);
}
}
/**
* 设置缓存
*
* @param key 缓存KEY
* @param value 缓存内容
*/
@Override
public void set(String key, String value) {
set(key, value, AuthCacheConfig.timeout);
}
/**
* 设置缓存
*
* @param key 缓存KEY
* @param value 缓存内容
* @param timeout 指定缓存过期时间毫秒
*/
@Override
public void set(String key, String value, long timeout) {
writeLock.lock();
try {
stateCache.put(key, new CacheState(value, timeout));
} finally {
writeLock.unlock();
}
}
/**
* 获取缓存
*
* @param key 缓存KEY
* @return 缓存内容
*/
@Override
public String get(String key) {
readLock.lock();
try {
CacheState cacheState = stateCache.get(key);
if (null == cacheState || cacheState.isExpired()) {
return null;
}
return cacheState.getState();
} finally {
readLock.unlock();
}
}
/**
* 是否存在key如果对应key的value值已过期也返回false
*
* @param key 缓存KEY
* @return true存在key并且value没过期falsekey不存在或者已过期
*/
@Override
public boolean containsKey(String key) {
readLock.lock();
try {
CacheState cacheState = stateCache.get(key);
return null != cacheState && !cacheState.isExpired();
} finally {
readLock.unlock();
}
}
/**
* 清理过期的缓存
*/
@Override
public void pruneCache() {
Iterator<CacheState> values = stateCache.values().iterator();
CacheState cacheState;
while (values.hasNext()) {
cacheState = values.next();
if (cacheState.isExpired()) {
values.remove();
}
}
}
/**
* 定时清理
*
* @param delay 间隔时长单位毫秒
*/
public void schedulePrune(long delay) {
AuthCacheScheduler.INSTANCE.schedule(this::pruneCache, delay);
}
@Getter
@Setter
private class CacheState implements Serializable {
private String state;
private long expire;
CacheState(String state, long expire) {
this.state = state;
// 实际过期时间等于当前时间加上有效期
this.expire = System.currentTimeMillis() + expire;
}
boolean isExpired() {
return System.currentTimeMillis() > this.expire;
}
}
}

View File

@ -0,0 +1,66 @@
package me.zhyd.oauth.cache;
/**
* 默认的state缓存实现
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.10.0
*/
public enum AuthDefaultStateCache implements AuthStateCache {
/**
* 当前实例
*/
INSTANCE;
private AuthCache authCache;
AuthDefaultStateCache() {
authCache = new AuthDefaultCache();
}
/**
* 存入缓存
*
* @param key 缓存key
* @param value 缓存内容
*/
@Override
public void cache(String key, String value) {
authCache.set(key, value);
}
/**
* 存入缓存
*
* @param key 缓存key
* @param value 缓存内容
* @param timeout 指定缓存过期时间毫秒
*/
@Override
public void cache(String key, String value, long timeout) {
authCache.set(key, value, timeout);
}
/**
* 获取缓存内容
*
* @param key 缓存key
* @return 缓存内容
*/
@Override
public String get(String key) {
return authCache.get(key);
}
/**
* 是否存在key如果对应key的value值已过期也返回false
*
* @param key 缓存key
* @return true存在key并且value没过期falsekey不存在或者已过期
*/
@Override
public boolean containsKey(String key) {
return authCache.containsKey(key);
}
}

View File

@ -0,0 +1,44 @@
package me.zhyd.oauth.cache;
/**
* <p>
* State缓存接口方便用户扩展
* </p>
*
* @author yangkai.shen
* @since 1.10.0
*/
public interface AuthStateCache {
/**
* 存入缓存
*
* @param key 缓存key
* @param value 缓存内容
*/
void cache(String key, String value);
/**
* 存入缓存
*
* @param key 缓存key
* @param value 缓存内容
* @param timeout 指定缓存过期时间毫秒
*/
void cache(String key, String value, long timeout);
/**
* 获取缓存内容
*
* @param key 缓存key
* @return 缓存内容
*/
String get(String key);
/**
* 是否存在key如果对应key的value值已过期也返回false
*
* @param key 缓存key
* @return true存在key并且value没过期falsekey不存在或者已过期
*/
boolean containsKey(String key);
}

View File

@ -0,0 +1,5 @@
/**
* JustAuth 缓存实现 提供基础的基于ConcurrentHashMap + ScheduledExecutorService 实现的定时缓存
* 同时对外暴露{@code AuthStateCache}接口可进行对缓存实现的自定义
*/
package me.zhyd.oauth.cache;

View File

@ -1,28 +1,32 @@
package me.zhyd.oauth.config;
import com.xkcoding.http.config.HttpConfig;
import lombok.*;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.utils.StringUtils;
import java.util.List;
/**
* JustAuth配置类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.8
*/
@Setter
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AuthConfig {
/**
* 客户端id对应平台的appKey
* 客户端id对应平台的appKey
*/
private String clientId;
/**
* 客户端Secret对应平台的appSecret
* 客户端Secret对应平台的appSecret
*/
private String clientSecret;
@ -33,6 +37,219 @@ public class AuthConfig {
/**
* 支付宝公钥当选择支付宝登录时该值可用
* 对应RSA2(SHA256)密钥中的支付宝公钥
*
* @deprecated 请使用AuthAlipayRequest的构造方法设置"alipayPublicKey"
*/
@Deprecated
private String alipayPublicKey;
/**
* 是否需要申请unionid目前只针对qq登录
* qq授权登录时获取unionid需要单独发送邮件申请权限如果个人开发者账号中申请了该权限可以将该值置为true在获取openId时就会同步获取unionId
* 参考链接http://wiki.connect.qq.com/unionid%E4%BB%8B%E7%BB%8D
* <p>
* 1.7.1版本新增参数
*/
private boolean unionId;
/**
* Stack Overflow Key
* <p>
*
* @since 1.9.0
*/
private String stackOverflowKey;
/**
* 企业微信授权方的网页应用ID
*
* @since 1.10.0
*/
private String agentId;
/**
* 企业微信第三方授权用户类型member|admin
*
* @since 1.10.0
*/
private String usertype;
/**
* 域名前缀
* <p>
* 使用 Coding 登录和 Okta 登录时需要传该值
* <p>
* Coding 登录团队域名前缀比如以 https://justauth.coding.net 为例{@code domainPrefix} = justauth
* <p>
* Okta 登录Okta 账号域名前缀比如以 https://justauth.okta.com 为例{@code domainPrefix} = justauth
*
* @since 1.16.0
*/
private String domainPrefix;
/**
* 针对国外服务可以单独设置代理
* HttpConfig config = new HttpConfig();
* config.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)));
* config.setTimeout(15000);
*
* @since 1.15.5
*/
private HttpConfig httpConfig;
/**
* 忽略校验 {@code state} 参数默认不开启 {@code ignoreCheckState} {@code true}
* {@link me.zhyd.oauth.request.AuthDefaultRequest#login(AuthCallback)} 将不会校验 {@code state} 的合法性
* <p>
* 使用场景当且仅当使用自实现 {@code state} 校验逻辑时开启
* <p>
* 以下场景使用方案仅作参考
* 1. 授权登录为同端并且全部使用 JustAuth 实现时该值建议设为 {@code false};
* 2. 授权和登录为不同端实现时比如前端页面拼装 {@code authorizeUrl}并且前端自行对{@code state}进行校验
* 后端只负责使用{@code code}获取用户信息时该值建议设为 {@code true};
*
* <strong>如非特殊需要不建议开启这个配置</strong>
* <p>
* 该方案主要为了解决以下类似场景的问题
*
* @see <a href="https://github.com/justauth/JustAuth/issues/83">https://github.com/justauth/JustAuth/issues/83</a>
* @since 1.15.6
*/
private boolean ignoreCheckState;
/**
* 支持自定义授权平台的 scope 内容
*
* @since 1.15.7
*/
private List<String> scopes;
/**
* 设备ID, 设备唯一标识ID
*
* @since 1.15.8
*/
private String deviceId;
/**
* 喜马拉雅客户端操作系统类型1-iOS系统2-Android系统3-Web
*
* @since 1.15.9
*/
private Integer clientOsType;
/**
* 喜马拉雅客户端包名如果 {@link AuthConfig#clientOsType} 为1或2时必填对Android客户端是包名对IOS客户端是Bundle ID
*
* @since 1.15.9
*/
private String packId;
/**
* 是否开启 PKCE 模式该配置仅用于支持 PKCE 模式的平台针对无服务应用不推荐使用隐式授权推荐使用 PKCE 模式
*
* @since 1.15.9
*/
private boolean pkce;
/**
* Okta 授权服务器的 ID 默认为 default如果要使用自定义授权服务此处传实际的授权服务器 ID一个随机串
* <p>
* 创建自定义授权服务器请参考
* <p>
* https://developer.okta.com/docs/concepts/auth-servers
* <p>
* https://developer.okta.com/docs/guides/customize-authz-server
*
* @since 1.16.0
*/
private String authServerId;
/**
* 忽略校验 {@code redirectUri} 参数默认不开启 {@code ignoreCheckRedirectUri} {@code true}
* {@link me.zhyd.oauth.utils.AuthChecker#checkConfig(AuthConfig, AuthSource)} 将不会校验 {@code redirectUri} 的合法性
*
* @since 1.16.1
*/
private boolean ignoreCheckRedirectUri;
/**
* 适配 builder 模式 set 值的情况
*
* @return authServerId
*/
public String getAuthServerId() {
return StringUtils.isEmpty(authServerId) ? "default" : authServerId;
}
/**
* Microsoft Entra ID原微软 AAD中的租户 ID
*/
private String tenantId;
/**
* 苹果开发者账号中的密钥标识符
* @see <a href="https://developer.apple.com/help/account/configure-app-capabilities/create-a-sign-in-with-apple-private-key/">create-a-sign-in-with-apple-private-key</a>
*/
private String kid;
/**
* 苹果开发者账号中的团队ID
* @see <a href="https://developer.apple.com/help/glossary/team-id/">team id</a>
*/
private String teamId;
/**
* 新版企业微信 Web 登录时的参数
*
* 登录类型ServiceApp服务商登录CorpApp企业自建/代开发应用登录
* @see <a href="https://developer.work.weixin.qq.com/document/path/98152">https://developer.work.weixin.qq.com/document/path/98152</a>
* @since 1.16.7
*/
private String loginType = "CorpApp";
/**
* 企业微信平台的语言编码
*
* @since 1.16.7
*/
private String lang = "zh";
/**
* 钉钉平台参数控制输出特定类型的组织列表org_type=management 表示只输出有管理权限的组织
*
* scope包含corpid时该参数存在意义
*
* @see <a href="https://open.dingtalk.com/document/orgapp/obtain-identity-credentials#title-4up-u8w-5ug">https://open.dingtalk.com/document/orgapp/obtain-identity-credentials#title-4up-u8w-5ug</a>
* @since 1.16.7
*/
private String dingTalkOrgType;
/**
* 钉钉平台参数用于指定用户需要选择的组织
*
* scope包含corpid时该参数存在意义传入的corpId需要是当前用户所在的组织
*
* @see <a href="https://open.dingtalk.com/document/orgapp/obtain-identity-credentials#title-4up-u8w-5ug">https://open.dingtalk.com/document/orgapp/obtain-identity-credentials#title-4up-u8w-5ug</a>
* @since 1.16.7
*/
private String dingTalkCorpId;
/**
* 钉钉平台参数true表示专属帐号登录展示组织代码输入页
*
* @see <a href="https://open.dingtalk.com/document/orgapp/obtain-identity-credentials#title-4up-u8w-5ug">https://open.dingtalk.com/document/orgapp/obtain-identity-credentials#title-4up-u8w-5ug</a>
* @since 1.16.7
*/
private boolean dingTalkExclusiveLogin;
/**
* 钉钉平台参数开启了专属帐号功能的组织corpId
*
* scope包含corpid时该参数存在意义传入的corpId需要是当前用户所在的组织
*
* @see <a href="https://open.dingtalk.com/document/orgapp/obtain-identity-credentials#title-4up-u8w-5ug">https://open.dingtalk.com/document/orgapp/obtain-identity-credentials#title-4up-u8w-5ug</a>
* @since 1.16.7
*/
private String dingTalkExclusiveCorpId;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,84 @@
package me.zhyd.oauth.config;
import me.zhyd.oauth.enums.AuthResponseStatus;
import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.request.AuthDefaultRequest;
/**
* OAuth平台的API地址的统一接口提供以下方法
* 1) {@link AuthSource#authorize()}: 获取授权url. 必须实现
* 2) {@link AuthSource#accessToken()}: 获取accessToken的url. 必须实现
* 3) {@link AuthSource#userInfo()}: 获取用户信息的url. 必须实现
* 4) {@link AuthSource#revoke()}: 获取取消授权的url. 非必须实现接口部分平台不支持
* 5) {@link AuthSource#refresh()}: 获取刷新授权的url. 非必须实现接口部分平台不支持
* <p>
*
* 如需通过JustAuth扩展实现第三方授权请参考{@link AuthDefaultSource}自行创建对应的枚举类并实现{@link AuthSource}接口
* 如果不是使用的枚举类那么在授权成功后获取用户信息时需要单独处理source字段的赋值
* 如果扩展了对应枚举类时{@link me.zhyd.oauth.request.AuthRequest#login(AuthCallback)}中可以通过{@code xx.toString()}获取对应的source
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.12.0
*/
public interface AuthSource {
/**
* 授权的api
*
* @return url
*/
String authorize();
/**
* 获取accessToken的api
*
* @return url
*/
String accessToken();
/**
* 获取用户信息的api
*
* @return url
*/
String userInfo();
/**
* 取消授权的api
*
* @return url
*/
default String revoke() {
throw new AuthException(AuthResponseStatus.UNSUPPORTED);
}
/**
* 刷新授权的api
*
* @return url
*/
default String refresh() {
throw new AuthException(AuthResponseStatus.UNSUPPORTED);
}
/**
* 获取Source的字符串名字
*
* @return name
*/
default String getName() {
if (this instanceof Enum) {
return String.valueOf(this);
}
return this.getClass().getSimpleName();
}
/**
* 平台对应的 AuthRequest 实现类必须继承自 {@link AuthDefaultRequest}
*
* @return class
*/
Class<? extends AuthDefaultRequest> getTargetClass();
}

View File

@ -0,0 +1,34 @@
package me.zhyd.oauth.config;
import me.zhyd.oauth.log.Log;
/**
* JustAuth 日志配置类
*
* @author HeJin
*/
public class JustAuthLogConfig {
/**
* 设置日志级别
*
* @param level 日志级别
*/
public static void setLevel(Log.Level level) {
Log.Config.level = level;
}
/**
* 关闭日志
*/
public static void disable() {
Log.Config.enable = false;
}
/**
* 开启日志
*/
public static void enable() {
Log.Config.enable = true;
}
}

View File

@ -0,0 +1,4 @@
/**
* JustAuth 核心配置相关包括{@code AuthConfig}{@code AuthSource}
*/
package me.zhyd.oauth.config;

View File

@ -1,485 +0,0 @@
package me.zhyd.oauth.consts;
import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.request.ResponseStatus;
/**
* 各api需要的url 用枚举类分平台类型管理
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @since 1.0
*/
public enum ApiUrl {
/**
* Github
*/
GITHUB {
@Override
public String authorize() {
return "https://github.com/login/oauth/authorize";
}
@Override
public String accessToken() {
return "https://github.com/login/oauth/access_token";
}
@Override
public String userInfo() {
return "https://api.github.com/user";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* 新浪微博
*/
WEIBO {
@Override
public String authorize() {
return "https://api.weibo.com/oauth2/authorize";
}
@Override
public String accessToken() {
return "https://api.weibo.com/oauth2/access_token";
}
@Override
public String userInfo() {
return "https://api.weibo.com/2/users/show.json";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* gitee
*/
GITEE {
@Override
public String authorize() {
return "https://gitee.com/oauth/authorize";
}
@Override
public String accessToken() {
return "https://gitee.com/oauth/token";
}
@Override
public String userInfo() {
return "https://gitee.com/api/v5/user";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* 钉钉
*/
DINGTALK {
@Override
public String authorize() {
return "https://oapi.dingtalk.com/connect/qrconnect";
}
@Override
public String accessToken() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String userInfo() {
return "https://oapi.dingtalk.com/sns/getuserinfo_bycode";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* 百度
*/
BAIDU {
@Override
public String authorize() {
return "https://openapi.baidu.com/oauth/2.0/authorize";
}
@Override
public String accessToken() {
return "https://openapi.baidu.com/oauth/2.0/token";
}
@Override
public String userInfo() {
return "https://openapi.baidu.com/rest/2.0/passport/users/getInfo";
}
@Override
public String revoke() {
return "https://openapi.baidu.com/rest/2.0/passport/auth/revokeAuthorization";
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* csdn
*/
CSDN {
@Override
public String authorize() {
return "https://api.csdn.net/oauth2/authorize";
}
@Override
public String accessToken() {
return "https://api.csdn.net/oauth2/access_token";
}
@Override
public String userInfo() {
return "https://api.csdn.net/user/getinfo";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* Coding
*/
CODING {
@Override
public String authorize() {
return "https://coding.net/oauth_authorize.html";
}
@Override
public String accessToken() {
return "https://coding.net/api/oauth/access_token";
}
@Override
public String userInfo() {
return "https://coding.net/api/account/current_user";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* 腾讯云开发者平台coding升级后就变成腾讯云开发者平台了
*/
TENCENTCLOUD {
@Override
public String authorize() {
return "https://dev.tencent.com/oauth_authorize.html";
}
@Override
public String accessToken() {
return "https://dev.tencent.com/api/oauth/access_token";
}
@Override
public String userInfo() {
return "https://dev.tencent.com/api/account/current_user";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* oschina 开源中国
*/
OSCHINA {
@Override
public String authorize() {
return "https://www.oschina.net/action/oauth2/authorize";
}
@Override
public String accessToken() {
return "https://www.oschina.net/action/openapi/token";
}
@Override
public String userInfo() {
return "https://www.oschina.net/action/openapi/user";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* 支付宝
*/
ALIPAY {
@Override
public String authorize() {
return "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm";
}
@Override
public String accessToken() {
return "https://openapi.alipay.com/gateway.do";
}
@Override
public String userInfo() {
return "https://openapi.alipay.com/gateway.do";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* QQ
*/
QQ {
@Override
public String authorize() {
return "https://graph.qq.com/oauth2.0/authorize";
}
@Override
public String accessToken() {
return "https://graph.qq.com/oauth2.0/token";
}
@Override
public String userInfo() {
return "https://graph.qq.com/user/get_user_info";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* 微信
*/
WECHAT {
@Override
public String authorize() {
return "https://open.weixin.qq.com/connect/qrconnect";
}
@Override
public String accessToken() {
return "https://api.weixin.qq.com/sns/oauth2/access_token";
}
@Override
public String userInfo() {
return "https://api.weixin.qq.com/sns/userinfo";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
return "https://api.weixin.qq.com/sns/oauth2/refresh_token";
}
},
/**
* 淘宝
*/
TAOBAO {
@Override
public String authorize() {
return "https://oauth.taobao.com/authorize";
}
@Override
public String accessToken() {
return "https://oauth.taobao.com/token";
}
@Override
public String userInfo() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* Google
*/
GOOGLE {
@Override
public String authorize() {
return "https://accounts.google.com/o/oauth2/v2/auth";
}
@Override
public String accessToken() {
return "https://www.googleapis.com/oauth2/v4/token";
}
@Override
public String userInfo() {
return "https://oauth2.googleapis.com/tokeninfo";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
},
/**
* Facebook
*/
FACEBOOK {
@Override
public String authorize() {
return "https://www.facebook.com/v3.3/dialog/oauth";
}
@Override
public String accessToken() {
return "https://graph.facebook.com/v3.3/oauth/access_token";
}
@Override
public String userInfo() {
return "https://graph.facebook.com/v3.3/me";
}
@Override
public String revoke() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
@Override
public String refresh() {
throw new AuthException(ResponseStatus.UNSUPPORTED);
}
};
/**
* 授权的api
*
* @return url
*/
public abstract String authorize();
/**
* 获取accessToken的api
*
* @return url
*/
public abstract String accessToken();
/**
* 获取用户信息的api
*
* @return url
*/
public abstract String userInfo();
/**
* 取消授权的api
*
* @return url
*/
public abstract String revoke();
/**
* 刷新授权的api
*
* @return url
*/
public abstract String refresh();
}

View File

@ -0,0 +1,42 @@
package me.zhyd.oauth.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* JustAuth通用的状态码对照表
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
*/
@Getter
@AllArgsConstructor
public enum AuthResponseStatus {
/**
* 2000正常
* other调用异常具体异常内容见{@code msg}
*/
SUCCESS(2000, "Success"),
FAILURE(5000, "Failure"),
NOT_IMPLEMENTED(5001, "Not Implemented"),
PARAMETER_INCOMPLETE(5002, "Parameter incomplete"),
UNSUPPORTED(5003, "Unsupported operation"),
NO_AUTH_SOURCE(5004, "AuthDefaultSource cannot be null"),
UNIDENTIFIED_PLATFORM(5005, "Unidentified platform"),
ILLEGAL_REDIRECT_URI(5006, "Illegal redirect uri"),
ILLEGAL_REQUEST(5007, "Illegal request"),
ILLEGAL_CODE(5008, "Illegal code"),
ILLEGAL_STATUS(5009, "Illegal state"),
REQUIRED_REFRESH_TOKEN(5010, "The refresh token is required; it must not be null"),
ILLEGAL_TOKEN(5011, "Invalid token"),
ILLEGAL_KID(5012, "Invalid key identifier(kid)"),
ILLEGAL_TEAM_ID(5013, "Invalid team id"),
ILLEGAL_CLIENT_ID(5014, "Invalid client id"),
ILLEGAL_CLIENT_SECRET(5015, "Invalid client secret"),
ILLEGAL_WECHAT_AGENT_ID(5016, "Illegal wechat agent id"),
;
private final int code;
private final String msg;
}

View File

@ -0,0 +1,49 @@
package me.zhyd.oauth.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 今日头条授权登录时的异常状态码
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
*/
@Getter
@AllArgsConstructor
public enum AuthToutiaoErrorCode {
/**
* 0正常
* other调用异常具体异常内容见{@code desc}
*/
EC0(0, "接口调用成功"),
EC1(1, "API配置错误未传入Client Key"),
EC2(2, "API配置错误Client Key错误请检查是否和开放平台的ClientKey一致"),
EC3(3, "没有授权信息"),
EC4(4, "响应类型错误"),
EC5(5, "授权类型错误"),
EC6(6, "client_secret错误"),
EC7(7, "authorize_code过期"),
EC8(8, "指定url的scheme不是https"),
EC9(9, "接口内部错误,请联系头条技术"),
EC10(10, "access_token过期"),
EC11(11, "缺少access_token"),
EC12(12, "参数缺失"),
EC13(13, "url错误"),
EC21(21, "域名与登记域名不匹配"),
EC999(999, "未知错误,请联系头条技术"),
;
private int code;
private String desc;
public static AuthToutiaoErrorCode getErrorCode(int errorCode) {
AuthToutiaoErrorCode[] errorCodes = AuthToutiaoErrorCode.values();
for (AuthToutiaoErrorCode code : errorCodes) {
if (code.getCode() == errorCode) {
return code;
}
}
return EC999;
}
}

View File

@ -0,0 +1,59 @@
package me.zhyd.oauth.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import me.zhyd.oauth.utils.StringUtils;
import java.util.Arrays;
/**
* 用户性别
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.8
*/
@Getter
@AllArgsConstructor
public enum AuthUserGender {
/**
* MALE/FAMALE为正常值通过{@link AuthUserGender#getRealGender(String)}方法获取真实的性别
* UNKNOWN为容错值部分平台不会返回用户性别为了方便统一使用UNKNOWN标记所有未知或不可测的用户性别信息
*/
MALE("1", ""),
FEMALE("0", ""),
UNKNOWN("-1", "未知");
private String code;
private String desc;
/**
* 获取用户的实际性别常规网站
*
* @param originalGender 用户第三方标注的原始性别
* @return 用户性别
*/
public static AuthUserGender getRealGender(String originalGender) {
if (null == originalGender || UNKNOWN.getCode().equals(originalGender)) {
return UNKNOWN;
}
String[] males = {"m", "", "1", "male"};
if (Arrays.asList(males).contains(originalGender.toLowerCase())) {
return MALE;
}
return FEMALE;
}
/**
* 获取微信平台用户的实际性别0表示未定义1表示男性2表示女性
*
* @param originalGender 用户第三方标注的原始性别
* @return 用户性别
* @since 1.13.2
*/
public static AuthUserGender getWechatRealGender(String originalGender) {
if (StringUtils.isEmpty(originalGender) || "0".equals(originalGender)) {
return AuthUserGender.UNKNOWN;
}
return getRealGender(originalGender);
}
}

View File

@ -0,0 +1,4 @@
/**
* 提供一些必要的枚举类
*/
package me.zhyd.oauth.enums;

View File

@ -0,0 +1,28 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Amazon平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.16.0
*/
@Getter
@AllArgsConstructor
public enum AuthAmazonScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
R_LITEPROFILE("profile", "The profile scope includes a user's name and email address", true),
R_EMAILADDRESS("profile:user_id", "The profile:user_id scope only includes the user_id field of the profile", true),
W_MEMBER_SOCIAL("postal_code", "This includes the user's zip/postal code number from their primary shipping address", true);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,19 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @see <a href="https://developer.apple.com/documentation/sign_in_with_apple/clientconfigi/3230955-scope/">scope</a>
*/
@Getter
@AllArgsConstructor
public enum AuthAppleScope implements AuthScope {
EMAIL("email", "用户邮箱", true),
NAME("name", "用户名", true),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,30 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 百度平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthBaiduScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
BASIC("basic", "用户基本权限,可以获取用户的基本信息 。", true),
SUPER_MSG("super_msg", "往用户的百度首页上发送消息提醒相关API任何应用都能使用但要想将消息提醒在百度首页显示需要第三方在注册应用时额外填写相关信息。", false),
NETDISK("netdisk", "获取用户在个人云存储中存放的数据。", false),
PUBLIC("public", "可以访问公共的开放API。", false),
HAO123("hao123", "可以访问Hao123 提供的开放API接口。该权限需要申请开通请将具体的理由和用途发邮件给tuangou@baidu.com。", false);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,31 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Coding平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthCodingScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
USER("user", "读取用户的基本信息", false),
USER_EMAIL("user:email", "读取用户的邮件", false),
USER_PHONE("user:phone", "读取用户的手机号", false),
PROJECT("project", "授权项目信息、项目列表,仓库信息,公钥列表、成员", false),
PROJECT_DEPOT("project:depot", "完整的仓库控制权限", false),
PROJECT_WIKI("project:wiki", "授权读取与操作 wiki", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,33 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 钉钉平台 OAuth 授权范围
*
* https://open.dingtalk.com/document/orgapp/obtain-identity-credentials#title-4up-u8w-5ug
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.16.7
*/
@Getter
@AllArgsConstructor
public enum AuthDingTalkScope implements AuthScope {
/**
* 无需申请 默认开启
*/
openid("openid", "授权后可获得用户userid", true),
/**
* 无需申请 默认开启
*/
corpid("corpid", "授权后可获得登录过程中用户选择的组织id", false)
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,68 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 抖音平台 OAuth 授权范围
*
* https://open.douyin.com/platform/doc/6855240178122983437
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.16.1
*/
@Getter
@AllArgsConstructor
public enum AuthDouyinScope implements AuthScope {
/**
* 无需申请 默认开启
*/
USER_INFO("user_info", "返回抖音用户公开信息", true),
/**
* 无需申请 默认开启
*/
AWEME_SHARE("aweme.share", "抖音分享", false),
/**
* 普通权限,管理中心申请
*/
IM_SHARE("im.share", "分享给抖音好友", false),
RENEW_REFRESH_TOKEN("renew_refresh_token", "授权有效期动态续期", false),
FOLLOWING_LIST("following.list", "获取该用户的关注列表", false),
FANS_LIST("fans.list", "获取该用户的粉丝列表", false),
VIDEO_CREATE("video.create", "视频发布及管理", false),
VIDEO_DELETE("video.delete", "删除内容", false),
VIDEO_DATA("video.data", "查询授权用户的抖音视频数据", false),
VIDEO_LIST("video.list", "查询特定抖音视频的视频数据", false),
/**
* 特殊权限 默认关闭 管理中心申请
*/
SHARE_WITH_SOURCE("share_with_source", "分享携带来源标签,用户可点击标签进入转化页", false),
MOBILE("mobile", "用抖音帐号登录第三方平台,获得用户在抖音上的手机号码", false),
MOBILE_ALERT("mobile_alert", "用抖音帐号登录第三方平台,获得用户在抖音上的手机号码", false),
VIDEO_SEARCH("video.search", "关键词视频管理", false),
POI_SEARCH("poi.search", "查询POI信息", false),
LOGIN_ID("login_id", "静默授权直接获取该用户的open id", false),
/**
* 抖音数据权限, 默认关闭, 管理中心申请
*/
DATA_EXTERNAL_USER("data.external.user", "查询用户的获赞、评论、分享,主页访问等相关数据", false),
DATA_EXTERNAL_ITEM("data.external.item", "查询作品的获赞,评论,分享等相关数据", false),
FANS_DATA("fans.data", "获取用户粉丝画像数据", false),
HOTSEARCH("hotsearch", "获取抖音热门内容", false),
STAR_TOP_SCORE_DISPLAY("star_top_score_display", "星图达人与达人对应各指数评估分以及星图6大热门维度下的达人榜单", false),
STAR_TOPS("star_tops", "星图达人与达人对应各指数评估分以及星图6大热门维度下的达人榜单", false),
STAR_AUTHOR_SCORE_DISPLAY("star_author_score_display", "星图达人与达人对应各指数评估分以及星图6大热门维度下的达人榜单", false),
notes("data.external.sdk_share", "获取用户通过分享SDK分享视频数据", false),
/**
* 定向开通 默认关闭 定向开通
*/
DISCOVERY_ENT("discovery.ent", "查询抖音电影榜、抖音剧集榜、抖音综艺榜数据", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,41 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Facebook 平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthFacebookScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
PUBLIC_PROFILE("public_profile", "权限允许应用读取用户默认的公开资料", true),
EMAIL("email", "获取用户的邮箱", false),
USER_AGE_RANGE("user_age_range", "允许应用程序访问用户的年龄范围", false),
USER_BIRTHDAY("user_birthday", "获取用户的生日", false),
USER_FRIENDS("user_friends", "获取用户的好友列表", false),
USER_GENDER("user_gender", "获取用户的性别", false),
USER_HOMETOWN("user_hometown", "获取用户的家乡信息", false),
USER_LIKES("user_likes", "获取用户的喜欢列表", false),
USER_LINK("user_link", "获取用户的个人链接", true),
USER_LOCATION("user_location", "获取用户的位置信息", false),
USER_PHOTOS("user_photos", "获取用户的相册信息", false),
USER_POSTS("user_posts", "获取用户发布的内容", false),
USER_VIDEOS("user_videos", "获取用户上传的视频信息", false),
GROUPS_ACCESS_MEMBER_INFO("groups_access_member_info", "获取公开的群组成员信息", false),
PUBLISH_TO_GROUPS("publish_to_groups", "授权您的应用程序代表某人将内容发布到组中,前提是他们已经授予您的应用程序访问权限", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,29 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Figma OAuth 授权范围
* <a href="https://www.figma.com/developers/api#authentication-scopes">...</a>
*
* @author xiangqian
* @since 1.16.6
*/
@Getter
@AllArgsConstructor
public enum AuthFigmaScope implements AuthScope {
FILE_CONTENT("files:read", "Read files, projects, users, versions, comments, components & styles, and webhooks", true),
VARIABLES("file_variables:read,file_variables:write", "Read and write to variables in Figma file. Note: this is only available to members in Enterprise organizations", false),
COMMENTS("file_comments:write", "Post and delete comments and comment reactions in files", false),
DEV_RESOURCES("file_dev_resources:read,file_dev_resources:write", "Read and write to dev resources in files", false),
LIBRARY_ANALYTICS("library_analytics:read", "Read your design system analytics", false),
WEBHOOKS("webhooks:write", "Create and manage webhooks", false);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,36 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Gitee 平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthGiteeScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
USER_INFO("user_info", "访问用户的个人信息、最新动态等", true),
PROJECTS("projects", "查看、创建、更新用户的项目", false),
PULL_REQUESTS("pull_requests", "查看、发布、更新用户的 Pull Request", false),
ISSUES("issues", "查看、发布、更新用户的 Issue", false),
NOTES("notes", "查看、发布、管理用户在项目、代码片段中的评论", false),
KEYS("keys", "查看、部署、删除用户的公钥", false),
HOOK("hook", "查看、部署、更新用户的 Webhook", false),
GROUPS("groups", "查看、管理用户的组织以及成员", false),
GISTS("gists", "查看、删除、更新用户的代码片段", false),
ENTERPRISES("enterprises", "查看、管理用户的企业以及成员", false),
EMAILS("emails", "查看用户的个人邮箱信息", false);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,54 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Github平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthGithubScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
REPO_STATUS("repo:status", "Grants read/write access to public and private repository commit statuses. This scope is only necessary to grant other users or services access to private repository commit statuses <em>without</em> granting access to the code.", false),
REPO_DEPLOYMENT("repo_deployment", "Grants access to deployment statuses for public and private repositories. This scope is only necessary to grant other users or services access to deployment statuses, <em>without</em> granting access to the code.", false),
PUBLIC_REPO("public_repo", "Limits access to public repositories. That includes read/write access to code, commit statuses, repository projects, collaborators, and deployment statuses for public repositories and organizations. Also required for starring public repositories.", false),
REPO_INVITE("repo:invite", "Grants accept/decline abilities for invitations to collaborate on a repository. This scope is only necessary to grant other users or services access to invites <em>without</em> granting access to the code.", false),
SECURITY_EVENTS("security_events", "Grants read and write access to security events in the code scanning API.", false),
WRITE_REPO_HOOK("write:repo_hook", "Grants read, write, and ping access to hooks in public or private repositories.", false),
READ_REPO_HOOK("read:repo_hook", "Grants read and ping access to hooks in public or private repositories.", false),
ADMIN_ORG("admin:org", "Fully manage the organization and its teams, projects, and memberships.", false),
WRITE_ORG("write:org", "Read and write access to organization membership, organization projects, and team membership.", false),
READ_ORG("read:org", "Read-only access to organization membership, organization projects, and team membership.", false),
ADMIN_PUBLIC_KEY("admin:public_key", "Fully manage public keys.", false),
WRITE_PUBLIC_KEY("write:public_key", "Create, list, and view details for public keys.", false),
READ_PUBLIC_KEY("read:public_key", "List and view details for public keys.", false),
GIST("gist", "Grants write access to gists.", false),
NOTIFICATIONS("notifications", "Grants: <br>* read access to a user's notifications <br>* mark as read access to threads <br>* watch and unwatch access to a repository, and <br>* read, write, and delete access to thread subscriptions.", false),
USER("user", "Grants read/write access to profile info only. Note that this scope includes <code>user:email</code> and <code>user:follow</code>.", false),
READ_USER("read:user", "Grants access to read a user's profile data.", false),
USER_EMAIL("user:email", "Grants read access to a user's email addresses.", false),
USER_FOLLOW("user:follow", "Grants access to follow or unfollow other users.", false),
DELETE_REPO("delete_repo", "Grants access to delete adminable repositories.", false),
WRITE_DISCUSSION("write:discussion", "Allows read and write access for team discussions.", false),
READ_DISCUSSION("read:discussion", "Allows read access for team discussions.", false),
WRITE_PACKAGES("write:packages", "Grants access to upload or publish a package in GitHub Packages. For more information, see \"<a href=\"https://help.github.com/github/managing-packages-with-github-packages/publishing-a-package\">Publishing a package</a>\" in the GitHub Help documentation.", false),
READ_PACKAGES("read:packages", "Grants access to download or install packages from GitHub Packages. For more information, see \"<a href=\"https://help.github.com/github/managing-packages-with-github-packages/installing-a-package\">Installing a package</a>\" in the GitHub Help documentation.", false),
DELETE_PACKAGES("delete:packages", "Grants access to delete packages from GitHub Packages. For more information, see \"<a href=\"https://help.github.com/github/managing-packages-with-github-packages/deleting-a-package\">Deleting packages</a>\" in the GitHub Help documentation.", false),
ADMIN_GPG_KEY("admin:gpg_key", "Fully manage GPG keys.", false),
WRITE_GPG_KEY("write:gpg_key", "Create, list, and view details for GPG keys.", false),
READ_GPG_KEY("read:gpg_key", "List and view details for GPG keys.", false),
WORKFLOW("workflow", "Grants the ability to add and update GitHub Actions workflow files. Workflow files can be committed without this scope if the same file (with both the same path and contents) exists on another branch in the same repository.", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,37 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Gitlab 平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthGitlabScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
READ_USER("read_user", "Grants read-only access to the authenticated user's profile through the /user API endpoint, which includes username, public email, and full name. Also grants access to read-only API endpoints under /users.", true),
OPENID("openid", "Grants permission to authenticate with GitLab using OpenID Connect. Also gives read-only access to the user's profile and group memberships.", true),
PROFILE("profile", "Grants read-only access to the user's profile data using OpenID Connect.", true),
EMAIL("email", "Grants read-only access to the user's primary email address using OpenID Connect.", true),
READ_API("read_api", "Grants read access to the API, including all groups and projects, the container registry, and the package registry.", false),
READ_REPOSITORY("read_repository", "Grants read-only access to repositories on private projects using Git-over-HTTP or the Repository Files API.", false),
WRITE_REPOSITORY("write_repository", "Grants read-write access to repositories on private projects using Git-over-HTTP (not using the API).", false),
READ_REGISTRY("read_registry", "Grants read-only access to container registry images on private projects.", false),
WRITE_REGISTRY("write_registry", "<span title=\"translation missing: en.doorkeeper.scope_desc.write_registry\">Write Registry</span>", false),
SUDO("sudo", "Grants permission to perform API actions as any user in the system, when authenticated as an admin user.", false),
API("api", "Grants complete read/write access to the API, including all groups and projects, the container registry, and the package registry.", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,471 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Google 平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthGoogleScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
USER_OPENID("openid", "Associate you with your personal info on Google", true),
USER_EMAIL("email", "View your email address", true),
USER_PROFILE("profile", "View your basic profile info", true),
USER_PHONENUMBERS_READ("https://www.googleapis.com/auth/user.phonenumbers.read", "View your phone numbers", false),
USER_ORGANIZATION_READ("https://www.googleapis.com/auth/user.organization.read", "See your education, work history and org info", false),
USER_GENDER_READ("https://www.googleapis.com/auth/user.gender.read", "See your gender", false),
USER_EMAILS_READ("https://www.googleapis.com/auth/user.emails.read", "View your email addresses", false),
USER_BIRTHDAY_READ("https://www.googleapis.com/auth/user.birthday.read", "View your complete date of birth", false),
USER_ADDRESSES_READ("https://www.googleapis.com/auth/user.addresses.read", "View your street addresses", false),
USERINFO_PROFILE("https://www.googleapis.com/auth/userinfo.profile", "See your personal info, including any personal info you've made publicly available", false),
USERINFO_EMAIL("https://www.googleapis.com/auth/userinfo.email", "View your email address", false),
YT_ANALYTICS_READONLY("https://www.googleapis.com/auth/yt-analytics.readonly", "View YouTube Analytics reports for your YouTube content", false),
YT_ANALYTICS_MONETARY_READONLY("https://www.googleapis.com/auth/yt-analytics-monetary.readonly", "View monetary and non-monetary YouTube Analytics reports for your YouTube content", false),
YOUTUBEPARTNER_CHANNEL_AUDIT("https://www.googleapis.com/auth/youtubepartner-channel-audit", "View private information of your YouTube channel relevant during the audit process with a YouTube partner", false),
YOUTUBEPARTNER("https://www.googleapis.com/auth/youtubepartner", "View and manage your assets and associated content on YouTube", false),
YOUTUBE_UPLOAD("https://www.googleapis.com/auth/youtube.upload", "Manage your YouTube videos", false),
YOUTUBE_READONLY("https://www.googleapis.com/auth/youtube.readonly", "View your YouTube account", false),
YOUTUBE_FORCE_SSL("https://www.googleapis.com/auth/youtube.force-ssl", "See, edit, and permanently delete your YouTube videos, ratings, comments and captions", false),
YOUTUBE_CHANNEL_MEMBERSHIPS_CREATOR("https://www.googleapis.com/auth/youtube.channel-memberships.creator", "See a list of your current active channel members, their current level, and when they became a member", false),
YOUTUBE("https://www.googleapis.com/auth/youtube", "Manage your YouTube account", false),
WEBMASTERS_READONLY("https://www.googleapis.com/auth/webmasters.readonly", "View Search Console data for your verified sites", false),
WEBMASTERS("https://www.googleapis.com/auth/webmasters", "View and manage Search Console data for your verified sites", false),
VERIFIEDACCESS("https://www.googleapis.com/auth/verifiedaccess", "Verify your enterprise credentials", false),
TRACE_APPEND("https://www.googleapis.com/auth/trace.append", "Write Trace data for a project or application", false),
TASKS_READONLY("https://www.googleapis.com/auth/tasks.readonly", "View your tasks", false),
TASKS("https://www.googleapis.com/auth/tasks", "Create, edit, organize, and delete all your tasks", false),
TAGMANAGER_READONLY("https://www.googleapis.com/auth/tagmanager.readonly", "View your Google Tag Manager container and its subcomponents", false),
TAGMANAGER_PUBLISH("https://www.googleapis.com/auth/tagmanager.publish", "Publish your Google Tag Manager container versions", false),
TAGMANAGER_MANAGE_USERS("https://www.googleapis.com/auth/tagmanager.manage.users", "Manage user permissions of your Google Tag Manager account and container", false),
TAGMANAGER_MANAGE_ACCOUNTS("https://www.googleapis.com/auth/tagmanager.manage.accounts", "View and manage your Google Tag Manager accounts", false),
TAGMANAGER_EDIT_CONTAINERVERSIONS("https://www.googleapis.com/auth/tagmanager.edit.containerversions", "Manage your Google Tag Manager container versions", false),
TAGMANAGER_EDIT_CONTAINERS("https://www.googleapis.com/auth/tagmanager.edit.containers", "Manage your Google Tag Manager container and its subcomponents, excluding versioning and publishing", false),
TAGMANAGER_DELETE_CONTAINERS("https://www.googleapis.com/auth/tagmanager.delete.containers", "Delete your Google Tag Manager containers", false),
STREETVIEWPUBLISH("https://www.googleapis.com/auth/streetviewpublish", "Publish and manage your 360 photos on Google Street View", false),
SQLSERVICE_ADMIN("https://www.googleapis.com/auth/sqlservice.admin", "Manage your Google SQL Service instances", false),
SPREADSHEETS_READONLY("https://www.googleapis.com/auth/spreadsheets.readonly", "View your Google Spreadsheets", false),
SPREADSHEETS("https://www.googleapis.com/auth/spreadsheets", "See, edit, create, and delete your spreadsheets in Google Drive", false),
SPANNER_DATA("https://www.googleapis.com/auth/spanner.data", "View and manage the contents of your Spanner databases", false),
SPANNER_ADMIN("https://www.googleapis.com/auth/spanner.admin", "Administer your Spanner databases", false),
SOURCE_READ_WRITE("https://www.googleapis.com/auth/source.read_write", "Manage the contents of your source code repositories", false),
SOURCE_READ_ONLY("https://www.googleapis.com/auth/source.read_only", "View the contents of your source code repositories", false),
SOURCE_FULL_CONTROL("https://www.googleapis.com/auth/source.full_control", "Manage your source code repositories", false),
SITEVERIFICATION_VERIFY_ONLY("https://www.googleapis.com/auth/siteverification.verify_only", "Manage your new site verifications with Google", false),
SITEVERIFICATION("https://www.googleapis.com/auth/siteverification", "Manage the list of sites and domains you control", false),
SERVICECONTROL("https://www.googleapis.com/auth/servicecontrol", "Manage your Google Service Control data", false),
SERVICE_MANAGEMENT_READONLY("https://www.googleapis.com/auth/service.management.readonly", "View your Google API service configuration", false),
SERVICE_MANAGEMENT("https://www.googleapis.com/auth/service.management", "Manage your Google API service configuration", false),
SCRIPT_PROJECTS_READONLY("https://www.googleapis.com/auth/script.projects.readonly", "View Google Apps Script projects", false),
SCRIPT_PROJECTS("https://www.googleapis.com/auth/script.projects", "Create and update Google Apps Script projects", false),
SCRIPT_PROCESSES("https://www.googleapis.com/auth/script.processes", "View Google Apps Script processes", false),
SCRIPT_METRICS("https://www.googleapis.com/auth/script.metrics", "View Google Apps Script project's metrics", false),
SCRIPT_DEPLOYMENTS_READONLY("https://www.googleapis.com/auth/script.deployments.readonly", "View Google Apps Script deployments", false),
SCRIPT_DEPLOYMENTS("https://www.googleapis.com/auth/script.deployments", "Create and update Google Apps Script deployments", false),
PUBSUB("https://www.googleapis.com/auth/pubsub", "View and manage Pub/Sub topics and subscriptions", false),
PRESENTATIONS_READONLY("https://www.googleapis.com/auth/presentations.readonly", "View your Google Slides presentations", false),
PRESENTATIONS("https://www.googleapis.com/auth/presentations", "View and manage your Google Slides presentations", false),
PHOTOSLIBRARY_SHARING("https://www.googleapis.com/auth/photoslibrary.sharing", "Manage and add to shared albums on your behalf", false),
PHOTOSLIBRARY_READONLY_APPCREATEDDATA("https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata", "Manage photos added by this app", false),
PHOTOSLIBRARY_READONLY("https://www.googleapis.com/auth/photoslibrary.readonly", "View your Google Photos library", false),
PHOTOSLIBRARY_APPENDONLY("https://www.googleapis.com/auth/photoslibrary.appendonly", "Add to your Google Photos library", false),
PHOTOSLIBRARY("https://www.googleapis.com/auth/photoslibrary", "View and manage your Google Photos library", false),
NDEV_CLOUDMAN_READONLY("https://www.googleapis.com/auth/ndev.cloudman.readonly", "View your Google Cloud Platform management resources and deployment status information", false),
NDEV_CLOUDMAN("https://www.googleapis.com/auth/ndev.cloudman", "View and manage your Google Cloud Platform management resources and deployment status information", false),
NDEV_CLOUDDNS_READWRITE("https://www.googleapis.com/auth/ndev.clouddns.readwrite", "View and manage your DNS records hosted by Google Cloud DNS", false),
NDEV_CLOUDDNS_READONLY("https://www.googleapis.com/auth/ndev.clouddns.readonly", "View your DNS records hosted by Google Cloud DNS", false),
MONITORING_WRITE("https://www.googleapis.com/auth/monitoring.write", "Publish metric data to your Google Cloud projects", false),
MONITORING_READ("https://www.googleapis.com/auth/monitoring.read", "View monitoring data for all of your Google Cloud and third-party projects", false),
MONITORING("https://www.googleapis.com/auth/monitoring", "View and write monitoring data for all of your Google and third-party Cloud and API projects", false),
MANUFACTURERCENTER("https://www.googleapis.com/auth/manufacturercenter", "Manage your product listings for Google Manufacturer Center", false),
LOGGING_WRITE("https://www.googleapis.com/auth/logging.write", "Submit log data for your projects", false),
LOGGING_READ("https://www.googleapis.com/auth/logging.read", "View log data for your projects", false),
LOGGING_ADMIN("https://www.googleapis.com/auth/logging.admin", "Administrate log data for your projects", false),
JOBS("https://www.googleapis.com/auth/jobs", "Manage job postings", false),
INDEXING("https://www.googleapis.com/auth/indexing", "Submit data to Google for indexing", false),
GROUPS("https://www.googleapis.com/auth/groups", "View and manage your Google Groups", false),
GMAIL("https://mail.google.com/", "Read, compose, send, and permanently delete all your email from Gmail", false),
GMAIL_SETTINGS_SHARING("https://www.googleapis.com/auth/gmail.settings.sharing", "Manage your sensitive mail settings, including who can manage your mail", false),
GMAIL_SETTINGS_BASIC("https://www.googleapis.com/auth/gmail.settings.basic", "Manage your basic mail settings", false),
GMAIL_SEND("https://www.googleapis.com/auth/gmail.send", "Send email on your behalf", false),
GMAIL_READONLY("https://www.googleapis.com/auth/gmail.readonly", "View your email messages and settings", false),
GMAIL_MODIFY("https://www.googleapis.com/auth/gmail.modify", "View and modify but not delete your email", false),
GMAIL_METADATA("https://www.googleapis.com/auth/gmail.metadata", "View your email message metadata such as labels and headers, but not the email body", false),
GMAIL_LABELS("https://www.googleapis.com/auth/gmail.labels", "Manage mailbox labels", false),
GMAIL_INSERT("https://www.googleapis.com/auth/gmail.insert", "Insert mail into your mailbox", false),
GMAIL_COMPOSE("https://www.googleapis.com/auth/gmail.compose", "Manage drafts and send emails", false),
GMAIL_ADDONS_CURRENT_MESSAGE_READONLY("https://www.googleapis.com/auth/gmail.addons.current.message.readonly", "View your email messages when the add-on is running", false),
GMAIL_ADDONS_CURRENT_MESSAGE_METADATA("https://www.googleapis.com/auth/gmail.addons.current.message.metadata", "View your email message metadata when the add-on is running", false),
GMAIL_ADDONS_CURRENT_MESSAGE_ACTION("https://www.googleapis.com/auth/gmail.addons.current.message.action", "View your email messages when you interact with the add-on", false),
GMAIL_ADDONS_CURRENT_ACTION_COMPOSE("https://www.googleapis.com/auth/gmail.addons.current.action.compose", "Manage drafts and send emails when you interact with the add-on", false),
GENOMICS("https://www.googleapis.com/auth/genomics", "View and manage Genomics data", false),
GAMES("https://www.googleapis.com/auth/games", "Create, edit, and delete your Google Play Games activity", false),
FORMS_CURRENTONLY("https://www.googleapis.com/auth/forms.currentonly", "View and manage forms that this application has been installed in", false),
FORMS("https://www.googleapis.com/auth/forms", "View and manage your forms in Google Drive", false),
FITNESS_REPRODUCTIVE_HEALTH_WRITE("https://www.googleapis.com/auth/fitness.reproductive_health.write", "See and add info about your reproductive health in Google Fit. I consent to Google sharing my reporductive health information with this app.", false),
FITNESS_REPRODUCTIVE_HEALTH_READ("https://www.googleapis.com/auth/fitness.reproductive_health.read", "See info about your reproductive health in Google Fit. I consent to Google sharing my reporductive health information with this app.", false),
FITNESS_OXYGEN_SATURATION_WRITE("https://www.googleapis.com/auth/fitness.oxygen_saturation.write", "See and add info about your oxygen saturation in Google Fit. I consent to Google sharing my oxygen saturation information with this app.", false),
FITNESS_OXYGEN_SATURATION_READ("https://www.googleapis.com/auth/fitness.oxygen_saturation.read", "See info about your oxygen saturation in Google Fit. I consent to Google sharing my oxygen saturation information with this app.", false),
FITNESS_NUTRITION_WRITE("https://www.googleapis.com/auth/fitness.nutrition.write", "See and add to info about your nutrition in Google Fit", false),
FITNESS_NUTRITION_READ("https://www.googleapis.com/auth/fitness.nutrition.read", "See info about your nutrition in Google Fit", false),
FITNESS_LOCATION_WRITE("https://www.googleapis.com/auth/fitness.location.write", "See and add to your Google Fit location data", false),
FITNESS_LOCATION_READ("https://www.googleapis.com/auth/fitness.location.read", "See your Google Fit speed and distance data", false),
FITNESS_BODY_TEMPERATURE_WRITE("https://www.googleapis.com/auth/fitness.body_temperature.write", "See and add to info about your body temperature in Google Fit. I consent to Google sharing my body temperature information with this app.", false),
FITNESS_BODY_TEMPERATURE_READ("https://www.googleapis.com/auth/fitness.body_temperature.read", "See info about your body temperature in Google Fit. I consent to Google sharing my body temperature information with this app.", false),
FITNESS_BODY_WRITE("https://www.googleapis.com/auth/fitness.body.write", "See and add info about your body measurements and heart rate to Google Fit", false),
FITNESS_BODY_READ("https://www.googleapis.com/auth/fitness.body.read", "See info about your body measurements and heart rate in Google Fit", false),
FITNESS_BLOOD_PRESSURE_WRITE("https://www.googleapis.com/auth/fitness.blood_pressure.write", "See and add info about your blood pressure in Google Fit. I consent to Google sharing my blood pressure information with this app.", false),
FITNESS_BLOOD_PRESSURE_READ("https://www.googleapis.com/auth/fitness.blood_pressure.read", "See info about your blood pressure in Google Fit. I consent to Google sharing my blood pressure information with this app.", false),
FITNESS_BLOOD_GLUCOSE_WRITE("https://www.googleapis.com/auth/fitness.blood_glucose.write", "See and add info about your blood glucose to Google Fit. I consent to Google sharing my blood glucose information with this app.", false),
FITNESS_BLOOD_GLUCOSE_READ("https://www.googleapis.com/auth/fitness.blood_glucose.read", "See info about your blood glucose in Google Fit. I consent to Google sharing my blood glucose information with this app.", false),
FITNESS_ACTIVITY_WRITE("https://www.googleapis.com/auth/fitness.activity.write", "See and add to your Google Fit physical activity data", false),
FITNESS_ACTIVITY_READ("https://www.googleapis.com/auth/fitness.activity.read", "Use Google Fit to see and store your physical activity data", false),
FIREBASE_READONLY("https://www.googleapis.com/auth/firebase.readonly", "View all your Firebase data and settings", false),
FIREBASE("https://www.googleapis.com/auth/firebase", "View and administer all your Firebase data and settings", false),
EDISCOVERY_READONLY("https://www.googleapis.com/auth/ediscovery.readonly", "View your eDiscovery data", false),
EDISCOVERY("https://www.googleapis.com/auth/ediscovery", "Manage your eDiscovery data", false),
DRIVE_SCRIPTS("https://www.googleapis.com/auth/drive.scripts", "Modify your Google Apps Script scripts' behavior", false),
DRIVE_READONLY("https://www.googleapis.com/auth/drive.readonly", "See and download all your Google Drive files", false),
DRIVE_PHOTOS_READONLY("https://www.googleapis.com/auth/drive.photos.readonly", "View the photos, videos and albums in your Google Photos", false),
DRIVE_METADATA_READONLY("https://www.googleapis.com/auth/drive.metadata.readonly", "View metadata for files in your Google Drive", false),
DRIVE_METADATA("https://www.googleapis.com/auth/drive.metadata", "View and manage metadata of files in your Google Drive", false),
DRIVE_FILE("https://www.googleapis.com/auth/drive.file", "View and manage Google Drive files and folders that you have opened or created with this app", false),
DRIVE_APPDATA("https://www.googleapis.com/auth/drive.appdata", "View and manage its own configuration data in your Google Drive", false),
DRIVE_ACTIVITY_READONLY("https://www.googleapis.com/auth/drive.activity.readonly", "View the activity record of files in your Google Drive", false),
DRIVE_ACTIVITY("https://www.googleapis.com/auth/drive.activity", "View and add to the activity record of files in your Google Drive", false),
DRIVE("https://www.googleapis.com/auth/drive", "See, edit, create, and delete all of your Google Drive files", false),
ACTIVITY("https://www.googleapis.com/auth/activity", "View the activity history of your Google apps", false),
DOUBLECLICKSEARCH("https://www.googleapis.com/auth/doubleclicksearch", "View and manage your advertising data in DoubleClick Search", false),
DOUBLECLICKBIDMANAGER("https://www.googleapis.com/auth/doubleclickbidmanager", "View and manage your reports in DoubleClick Bid Manager", false),
DOCUMENTS_READONLY("https://www.googleapis.com/auth/documents.readonly", "View your Google Docs documents", false),
DOCUMENTS("https://www.googleapis.com/auth/documents", "View and manage your Google Docs documents", false),
DISPLAY_VIDEO("https://www.googleapis.com/auth/display-video", "Create, see, edit, and permanently delete your Display & Video 360 entities and reports", false),
DIRECTORY_READONLY("https://www.googleapis.com/auth/directory.readonly", "See and download your organization's GSuite directory", false),
DIALOGFLOW("https://www.googleapis.com/auth/dialogflow", "View, manage and query your Dialogflow agents", false),
DFATRAFFICKING("https://www.googleapis.com/auth/dfatrafficking", "View and manage your DoubleClick Campaign Manager's (DCM) display ad campaigns", false),
DFAREPORTING("https://www.googleapis.com/auth/dfareporting", "View and manage DoubleClick for Advertisers reports", false),
DEVSTORAGE_READ_WRITE("https://www.googleapis.com/auth/devstorage.read_write", "Manage your data in Google Cloud Storage", false),
DEVSTORAGE_READ_ONLY("https://www.googleapis.com/auth/devstorage.read_only", "View your data in Google Cloud Storage", false),
DEVSTORAGE_FULL_CONTROL("https://www.googleapis.com/auth/devstorage.full_control", "Manage your data and permissions in Google Cloud Storage", false),
DDMCONVERSIONS("https://www.googleapis.com/auth/ddmconversions", "Manage DoubleClick Digital Marketing conversions", false),
DATASTORE("https://www.googleapis.com/auth/datastore", "View and manage your Google Cloud Datastore data", false),
CONTENT("https://www.googleapis.com/auth/content", "Manage your product listings and accounts for Google Shopping", false),
CONTACTS_READONLY("https://www.googleapis.com/auth/contacts.readonly", "See and download your contacts", false),
CONTACTS_OTHER_READONLY("https://www.googleapis.com/auth/contacts.other.readonly", "See and download contact info automatically saved in your \"Other contacts\"", false),
CONTACTS("https://www.googleapis.com/auth/contacts", "See, edit, download, and permanently delete your contacts", false),
CONTACTS_FEEDS("https://www.google.com/m8/feeds", "See, edit, download, and permanently delete your contacts", false),
COMPUTE_READONLY("https://www.googleapis.com/auth/compute.readonly", "View your Google Compute Engine resources", false),
COMPUTE("https://www.googleapis.com/auth/compute", "View and manage your Google Compute Engine resources", false),
CLOUDRUNTIMECONFIG("https://www.googleapis.com/auth/cloudruntimeconfig", "Manage your Google Cloud Platform services' runtime configuration", false),
CLOUDKMS("https://www.googleapis.com/auth/cloudkms", "View and manage your keys and secrets stored in Cloud Key Management Service", false),
CLOUDIOT("https://www.googleapis.com/auth/cloudiot", "Register and manage devices in the Google Cloud IoT service", false),
CLOUD_SEARCH_STATS_INDEXING("https://www.googleapis.com/auth/cloud_search.stats.indexing", "Index and serve your organization's data with Cloud Search", false),
CLOUD_SEARCH_STATS("https://www.googleapis.com/auth/cloud_search.stats", "Index and serve your organization's data with Cloud Search", false),
CLOUD_SEARCH_SETTINGS_QUERY("https://www.googleapis.com/auth/cloud_search.settings.query", "Index and serve your organization's data with Cloud Search", false),
CLOUD_SEARCH_SETTINGS_INDEXING("https://www.googleapis.com/auth/cloud_search.settings.indexing", "Index and serve your organization's data with Cloud Search", false),
CLOUD_SEARCH_SETTINGS("https://www.googleapis.com/auth/cloud_search.settings", "Index and serve your organization's data with Cloud Search", false),
CLOUD_SEARCH_QUERY("https://www.googleapis.com/auth/cloud_search.query", "Search your organization's data in the Cloud Search index", false),
CLOUD_SEARCH_INDEXING("https://www.googleapis.com/auth/cloud_search.indexing", "Index and serve your organization's data with Cloud Search", false),
CLOUD_SEARCH_DEBUG("https://www.googleapis.com/auth/cloud_search.debug", "Index and serve your organization's data with Cloud Search", false),
CLOUD_SEARCH("https://www.googleapis.com/auth/cloud_search", "Index and serve your organization's data with Cloud Search", false),
CLOUD_DEBUGGER("https://www.googleapis.com/auth/cloud_debugger", "Use Stackdriver Debugger", false),
CLOUD_VISION("https://www.googleapis.com/auth/cloud-vision", "Apply machine learning models to understand and label images", false),
CLOUD_TRANSLATION("https://www.googleapis.com/auth/cloud-translation", "Translate text from one language to another using Google Translate", false),
CLOUD_PLATFORM_READ_ONLY("https://www.googleapis.com/auth/cloud-platform.read-only", "View your data across Google Cloud Platform services", false),
CLOUD_PLATFORM("https://www.googleapis.com/auth/cloud-platform", "View and manage your data across Google Cloud Platform services", false),
CLOUD_LANGUAGE("https://www.googleapis.com/auth/cloud-language", "Apply machine learning models to reveal the structure and meaning of text", false),
CLOUD_IDENTITY_GROUPS_READONLY("https://www.googleapis.com/auth/cloud-identity.groups.readonly", "See any Cloud Identity Groups that you can access, including group members and their emails", false),
CLOUD_IDENTITY_GROUPS("https://www.googleapis.com/auth/cloud-identity.groups", "See, change, create, and delete any of the Cloud Identity Groups that you can access, including the members of each group", false),
CLOUD_BIGTABLE_ADMIN_TABLE("https://www.googleapis.com/auth/cloud-bigtable.admin.table", "Administer your Cloud Bigtable tables", false),
CLOUD_BIGTABLE_ADMIN_CLUSTER("https://www.googleapis.com/auth/cloud-bigtable.admin.cluster", "Administer your Cloud Bigtable clusters", false),
CLOUD_BIGTABLE_ADMIN("https://www.googleapis.com/auth/cloud-bigtable.admin", "Administer your Cloud Bigtable tables and clusters", false),
CLASSROOM_TOPICS_READONLY("https://www.googleapis.com/auth/classroom.topics.readonly", "View topics in Google Classroom", false),
CLASSROOM_TOPICS("https://www.googleapis.com/auth/classroom.topics", "See, create, and edit topics in Google Classroom", false),
CLASSROOM_STUDENT_SUBMISSIONS_STUDENTS_READONLY("https://www.googleapis.com/auth/classroom.student-submissions.students.readonly", "View course work and grades for students in the Google Classroom classes you teach or administer", false),
CLASSROOM_STUDENT_SUBMISSIONS_ME_READONLY("https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", "View your course work and grades in Google Classroom", false),
CLASSROOM_ROSTERS_READONLY("https://www.googleapis.com/auth/classroom.rosters.readonly", "View your Google Classroom class rosters", false),
CLASSROOM_ROSTERS("https://www.googleapis.com/auth/classroom.rosters", "Manage your Google Classroom class rosters", false),
CLASSROOM_PUSH_NOTIFICATIONS("https://www.googleapis.com/auth/classroom.push-notifications", "Receive notifications about your Google Classroom data", false),
CLASSROOM_PROFILE_PHOTOS("https://www.googleapis.com/auth/classroom.profile.photos", "View the profile photos of people in your classes", false),
CLASSROOM_PROFILE_EMAILS("https://www.googleapis.com/auth/classroom.profile.emails", "View the email addresses of people in your classes", false),
CLASSROOM_GUARDIANLINKS_STUDENTS_READONLY("https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly", "View guardians for students in your Google Classroom classes", false),
CLASSROOM_GUARDIANLINKS_STUDENTS("https://www.googleapis.com/auth/classroom.guardianlinks.students", "View and manage guardians for students in your Google Classroom classes", false),
CLASSROOM_GUARDIANLINKS_ME_READONLY("https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly", "View your Google Classroom guardians", false),
CLASSROOM_COURSEWORK_STUDENTS_READONLY("https://www.googleapis.com/auth/classroom.coursework.students.readonly", "View course work and grades for students in the Google Classroom classes you teach or administer", false),
CLASSROOM_COURSEWORK_STUDENTS("https://www.googleapis.com/auth/classroom.coursework.students", "Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer", false),
CLASSROOM_COURSEWORK_ME_READONLY("https://www.googleapis.com/auth/classroom.coursework.me.readonly", "View your course work and grades in Google Classroom", false),
CLASSROOM_COURSEWORK_ME("https://www.googleapis.com/auth/classroom.coursework.me", "Manage your course work and view your grades in Google Classroom", false),
CLASSROOM_COURSES_READONLY("https://www.googleapis.com/auth/classroom.courses.readonly", "View your Google Classroom classes", false),
CLASSROOM_COURSES("https://www.googleapis.com/auth/classroom.courses", "Manage your Google Classroom classes", false),
CLASSROOM_ANNOUNCEMENTS_READONLY("https://www.googleapis.com/auth/classroom.announcements.readonly", "View announcements in Google Classroom", false),
CLASSROOM_ANNOUNCEMENTS("https://www.googleapis.com/auth/classroom.announcements", "View and manage announcements in Google Classroom", false),
CALENDAR_SETTINGS_READONLY("https://www.googleapis.com/auth/calendar.settings.readonly", "View your Calendar settings", false),
CALENDAR_READONLY("https://www.googleapis.com/auth/calendar.readonly", "View your calendars", false),
CALENDAR_EVENTS_READONLY("https://www.googleapis.com/auth/calendar.events.readonly", "View events on all your calendars", false),
CALENDAR_EVENTS("https://www.googleapis.com/auth/calendar.events", "View and edit events on all your calendars", false),
CALENDAR("https://www.googleapis.com/auth/calendar", "See, edit, share, and permanently delete all the calendars you can access using Google Calendar", false),
CALENDAR_FEEDS("https://www.google.com/calendar/feeds", "See, edit, share, and permanently delete all the calendars you can access using Google Calendar", false),
BOOKS("https://www.googleapis.com/auth/books", "Manage your books", false),
BLOGGER_READONLY("https://www.googleapis.com/auth/blogger.readonly", "View your Blogger account", false),
BLOGGER("https://www.googleapis.com/auth/blogger", "Manage your Blogger account", false),
BIGTABLE_ADMIN_TABLE("https://www.googleapis.com/auth/bigtable.admin.table", "Administer your Cloud Bigtable tables", false),
BIGTABLE_ADMIN_INSTANCE("https://www.googleapis.com/auth/bigtable.admin.instance", "Administer your Cloud Bigtable clusters", false),
BIGTABLE_ADMIN_CLUSTER("https://www.googleapis.com/auth/bigtable.admin.cluster", "Administer your Cloud Bigtable clusters", false),
BIGTABLE_ADMIN("https://www.googleapis.com/auth/bigtable.admin", "Administer your Cloud Bigtable tables and clusters", false),
BIGQUERY_READONLY("https://www.googleapis.com/auth/bigquery.readonly", "View your data in Google BigQuery", false),
BIGQUERY_INSERTDATA("https://www.googleapis.com/auth/bigquery.insertdata", "Insert data into Google BigQuery", false),
BIGQUERY("https://www.googleapis.com/auth/bigquery", "View and manage your data in Google BigQuery", false),
APPS_ORDER_READONLY("https://www.googleapis.com/auth/apps.order.readonly", "Manage users on your domain", false),
APPS_ORDER("https://www.googleapis.com/auth/apps.order", "Manage users on your domain", false),
APPS_LICENSING("https://www.googleapis.com/auth/apps.licensing", "View and manage G Suite licenses for your domain", false),
APPS_GROUPS_SETTINGS("https://www.googleapis.com/auth/apps.groups.settings", "View and manage the settings of a G Suite group", false),
APPS_GROUPS_MIGRATION("https://www.googleapis.com/auth/apps.groups.migration", "Manage messages in groups on your domain", false),
APPS_ALERTS("https://www.googleapis.com/auth/apps.alerts", "See and delete your domain's G Suite alerts, and send alert feedback", false),
APPENGINE_ADMIN("https://www.googleapis.com/auth/appengine.admin", "View and manage your applications deployed on Google App Engine", false),
ANDROIDPUBLISHER("https://www.googleapis.com/auth/androidpublisher", "View and manage your Google Play Developer account", false),
ANDROIDMANAGEMENT("https://www.googleapis.com/auth/androidmanagement", "Manage Android devices and apps for your customers", false),
ANDROIDENTERPRISE("https://www.googleapis.com/auth/androidenterprise", "Manage corporate Android devices", false),
ANALYTICS_USER_DELETION("https://www.googleapis.com/auth/analytics.user.deletion", "Manage Google Analytics user deletion requests", false),
ANALYTICS_READONLY("https://www.googleapis.com/auth/analytics.readonly", "View your Google Analytics data", false),
ANALYTICS_PROVISION("https://www.googleapis.com/auth/analytics.provision", "Create a new Google Analytics account along with its default property and view", false),
ANALYTICS_MANAGE_USERS_READONLY("https://www.googleapis.com/auth/analytics.manage.users.readonly", "View Google Analytics user permissions", false),
ANALYTICS_MANAGE_USERS("https://www.googleapis.com/auth/analytics.manage.users", "Manage Google Analytics Account users by email address", false),
ANALYTICS_EDIT("https://www.googleapis.com/auth/analytics.edit", "Edit Google Analytics management entities", false),
ANALYTICS("https://www.googleapis.com/auth/analytics", "View and manage your Google Analytics data", false),
ADSENSEHOST("https://www.googleapis.com/auth/adsensehost", "View and manage your AdSense host data and associated accounts", false),
ADSENSE_READONLY("https://www.googleapis.com/auth/adsense.readonly", "View your AdSense data", false),
ADSENSE("https://www.googleapis.com/auth/adsense", "View and manage your AdSense data", false),
ADMIN_REPORTS_USAGE_READONLY("https://www.googleapis.com/auth/admin.reports.usage.readonly", "View usage reports for your G Suite domain", false),
ADMIN_REPORTS_AUDIT_READONLY("https://www.googleapis.com/auth/admin.reports.audit.readonly", "View audit reports for your G Suite domain", false),
ADMIN_DIRECTORY_USERSCHEMA_READONLY("https://www.googleapis.com/auth/admin.directory.userschema.readonly", "View user schemas on your domain", false),
ADMIN_DIRECTORY_USERSCHEMA("https://www.googleapis.com/auth/admin.directory.userschema", "View and manage the provisioning of user schemas on your domain", false),
ADMIN_DIRECTORY_USER_SECURITY("https://www.googleapis.com/auth/admin.directory.user.security", "Manage data access permissions for users on your domain", false),
ADMIN_DIRECTORY_USER_READONLY("https://www.googleapis.com/auth/admin.directory.user.readonly", "View users on your domain", false),
ADMIN_DIRECTORY_USER_ALIAS_READONLY("https://www.googleapis.com/auth/admin.directory.user.alias.readonly", "View user aliases on your domain", false),
ADMIN_DIRECTORY_USER_ALIAS("https://www.googleapis.com/auth/admin.directory.user.alias", "View and manage user aliases on your domain", false),
ADMIN_DIRECTORY_USER("https://www.googleapis.com/auth/admin.directory.user", "View and manage the provisioning of users on your domain", false),
ADMIN_DIRECTORY_ROLEMANAGEMENT_READONLY("https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly", "View delegated admin roles for your domain", false),
ADMIN_DIRECTORY_ROLEMANAGEMENT("https://www.googleapis.com/auth/admin.directory.rolemanagement", "Manage delegated admin roles for your domain", false),
ADMIN_DIRECTORY_RESOURCE_CALENDAR_READONLY("https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly", "View calendar resources on your domain", false),
ADMIN_DIRECTORY_RESOURCE_CALENDAR("https://www.googleapis.com/auth/admin.directory.resource.calendar", "View and manage the provisioning of calendar resources on your domain", false),
ADMIN_DIRECTORY_ORGUNIT_READONLY("https://www.googleapis.com/auth/admin.directory.orgunit.readonly", "View organization units on your domain", false),
ADMIN_DIRECTORY_ORGUNIT("https://www.googleapis.com/auth/admin.directory.orgunit", "View and manage organization units on your domain", false),
ADMIN_DIRECTORY_NOTIFICATIONS("https://www.googleapis.com/auth/admin.directory.notifications", "View and manage notifications received on your domain", false),
ADMIN_DIRECTORY_GROUP_READONLY("https://www.googleapis.com/auth/admin.directory.group.readonly", "View groups on your domain", false),
ADMIN_DIRECTORY_GROUP_MEMBER_READONLY("https://www.googleapis.com/auth/admin.directory.group.member.readonly", "View group subscriptions on your domain", false),
ADMIN_DIRECTORY_GROUP_MEMBER("https://www.googleapis.com/auth/admin.directory.group.member", "View and manage group subscriptions on your domain", false),
ADMIN_DIRECTORY_GROUP("https://www.googleapis.com/auth/admin.directory.group", "View and manage the provisioning of groups on your domain", false),
ADMIN_DIRECTORY_DOMAIN_READONLY("https://www.googleapis.com/auth/admin.directory.domain.readonly", "View domains related to your customers", false),
ADMIN_DIRECTORY_DOMAIN("https://www.googleapis.com/auth/admin.directory.domain", "View and manage the provisioning of domains for your customers", false),
ADMIN_DIRECTORY_DEVICE_MOBILE_READONLY("https://www.googleapis.com/auth/admin.directory.device.mobile.readonly", "View your mobile devices' metadata", false),
ADMIN_DIRECTORY_DEVICE_MOBILE_ACTION("https://www.googleapis.com/auth/admin.directory.device.mobile.action", "Manage your mobile devices by performing administrative tasks", false),
ADMIN_DIRECTORY_DEVICE_MOBILE("https://www.googleapis.com/auth/admin.directory.device.mobile", "View and manage your mobile devices' metadata", false),
ADMIN_DIRECTORY_DEVICE_CHROMEOS_READONLY("https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly", "View your Chrome OS devices' metadata", false),
ADMIN_DIRECTORY_DEVICE_CHROMEOS("https://www.googleapis.com/auth/admin.directory.device.chromeos", "View and manage your Chrome OS devices' metadata", false),
ADMIN_DIRECTORY_CUSTOMER_READONLY("https://www.googleapis.com/auth/admin.directory.customer.readonly", "View customer related information", false),
ADMIN_DIRECTORY_CUSTOMER("https://www.googleapis.com/auth/admin.directory.customer", "View and manage customer related information", false),
ADMIN_DATATRANSFER_READONLY("https://www.googleapis.com/auth/admin.datatransfer.readonly", "View data transfers between users in your organization", false),
ADMIN_DATATRANSFER("https://www.googleapis.com/auth/admin.datatransfer", "View and manage data transfers between users in your organization", false),
ADEXCHANGE_BUYER("https://www.googleapis.com/auth/adexchange.buyer", "Manage your Ad Exchange buyer account configuration", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
public static List<String> getAdminDirectoryScopes() {
return Arrays.stream(new AuthGoogleScope[]{
ADMIN_DIRECTORY_USERSCHEMA_READONLY,
ADMIN_DIRECTORY_USERSCHEMA,
ADMIN_DIRECTORY_USER_SECURITY,
ADMIN_DIRECTORY_USER_READONLY,
ADMIN_DIRECTORY_USER_ALIAS_READONLY,
ADMIN_DIRECTORY_USER_ALIAS,
ADMIN_DIRECTORY_USER,
ADMIN_DIRECTORY_ROLEMANAGEMENT_READONLY,
ADMIN_DIRECTORY_ROLEMANAGEMENT,
ADMIN_DIRECTORY_RESOURCE_CALENDAR_READONLY,
ADMIN_DIRECTORY_RESOURCE_CALENDAR,
ADMIN_DIRECTORY_ORGUNIT_READONLY,
ADMIN_DIRECTORY_ORGUNIT,
ADMIN_DIRECTORY_NOTIFICATIONS,
ADMIN_DIRECTORY_GROUP_READONLY,
ADMIN_DIRECTORY_GROUP_MEMBER_READONLY,
ADMIN_DIRECTORY_GROUP_MEMBER,
ADMIN_DIRECTORY_GROUP,
ADMIN_DIRECTORY_DOMAIN_READONLY,
ADMIN_DIRECTORY_DOMAIN,
ADMIN_DIRECTORY_DEVICE_MOBILE_READONLY,
ADMIN_DIRECTORY_DEVICE_MOBILE_ACTION,
ADMIN_DIRECTORY_DEVICE_MOBILE,
ADMIN_DIRECTORY_DEVICE_CHROMEOS_READONLY,
ADMIN_DIRECTORY_DEVICE_CHROMEOS,
ADMIN_DIRECTORY_CUSTOMER_READONLY,
ADMIN_DIRECTORY_CUSTOMER
}).map(AuthGoogleScope::getScope).collect(Collectors.toList());
}
/**
* View And manage user's mail in Gmail.
*
* @return List
*/
public static List<String> getGmailScopes() {
return Arrays.stream(new AuthGoogleScope[]{
GMAIL,
GMAIL_SETTINGS_SHARING,
GMAIL_SETTINGS_BASIC,
GMAIL_SEND,
GMAIL_READONLY,
GMAIL_MODIFY,
GMAIL_METADATA,
GMAIL_LABELS,
GMAIL_INSERT,
GMAIL_COMPOSE,
GMAIL_ADDONS_CURRENT_MESSAGE_READONLY,
GMAIL_ADDONS_CURRENT_MESSAGE_METADATA,
GMAIL_ADDONS_CURRENT_MESSAGE_ACTION,
GMAIL_ADDONS_CURRENT_ACTION_COMPOSE
}).map(AuthGoogleScope::getScope).collect(Collectors.toList());
}
/**
* Used for OIDC authorization and certification
*
* @return List
*/
public static List<String> getOidcScopes() {
return Arrays.stream(new AuthGoogleScope[]{
USER_OPENID,
USER_EMAIL,
USER_PROFILE
}).map(AuthGoogleScope::getScope).collect(Collectors.toList());
}
/**
* View And manage user's detail and Google Contacts.
*
* @return List
*/
public static List<String> getPeopleScopes() {
return Arrays.stream(new AuthGoogleScope[]{
CONTACTS_READONLY,
CONTACTS_OTHER_READONLY,
CONTACTS,
CONTACTS_FEEDS,
DIRECTORY_READONLY,
USER_PHONENUMBERS_READ,
USER_ORGANIZATION_READ,
USER_GENDER_READ,
USER_EMAILS_READ,
USER_BIRTHDAY_READ,
USER_ADDRESSES_READ,
USERINFO_PROFILE,
USERINFO_EMAIL
}).map(AuthGoogleScope::getScope).collect(Collectors.toList());
}
/**
* View and manage user's photo library.
*
* @return List
*/
public static List<String> getPhotosLibraryScopes() {
return Arrays.stream(new AuthGoogleScope[]{
PHOTOSLIBRARY_SHARING,
PHOTOSLIBRARY_READONLY_APPCREATEDDATA,
PHOTOSLIBRARY_READONLY,
PHOTOSLIBRARY_APPENDONLY,
PHOTOSLIBRARY
}).map(AuthGoogleScope::getScope).collect(Collectors.toList());
}
/**
* View And manage user's videos, activity and playlists.
*
* @return List
*/
public static List<String> getYouTubeScopes() {
return Arrays.stream(new AuthGoogleScope[]{
YT_ANALYTICS_READONLY,
YT_ANALYTICS_MONETARY_READONLY,
YOUTUBEPARTNER_CHANNEL_AUDIT,
YOUTUBEPARTNER,
YOUTUBE_UPLOAD,
YOUTUBE_READONLY,
YOUTUBE_FORCE_SSL,
YOUTUBE_CHANNEL_MEMBERSHIPS_CREATOR,
YOUTUBE
}).map(AuthGoogleScope::getScope).collect(Collectors.toList());
}
/**
* View And manage user's Google Analytics.
*
* @return List
*/
public static List<String> getGoogleAnalyticsScopes() {
return Arrays.stream(new AuthGoogleScope[]{
ANALYTICS_USER_DELETION,
ANALYTICS_READONLY,
ANALYTICS_PROVISION,
ANALYTICS_MANAGE_USERS_READONLY,
ANALYTICS_MANAGE_USERS,
ANALYTICS_EDIT,
ANALYTICS
}).map(AuthGoogleScope::getScope).collect(Collectors.toList());
}
/**
* View And manage user's calendars in Google Calendar.
*
* @return List
*/
public static List<String> getCalendarScopes() {
return Arrays.stream(new AuthGoogleScope[]{
CALENDAR_SETTINGS_READONLY,
CALENDAR_READONLY,
CALENDAR_EVENTS_READONLY,
CALENDAR_EVENTS,
CALENDAR,
CALENDAR_FEEDS
}).map(AuthGoogleScope::getScope).collect(Collectors.toList());
}
/**
* List, download, create, move, edit, share and search all of user's documents and files in Google Drive.
*
* @return List
*/
public static List<String> getDriveScopes() {
return Arrays.stream(new AuthGoogleScope[]{
DRIVE_SCRIPTS,
DRIVE_READONLY,
DRIVE_PHOTOS_READONLY,
DRIVE_METADATA_READONLY,
DRIVE_METADATA,
DRIVE_FILE,
DRIVE_APPDATA,
DRIVE_ACTIVITY_READONLY,
DRIVE_ACTIVITY,
DRIVE,
ACTIVITY
}).map(AuthGoogleScope::getScope).collect(Collectors.toList());
}
}

View File

@ -0,0 +1,49 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 华为平台 OAuth 授权范围
*
* 当前方式未来可能被废弃建议使用 {@link AuthHuaweiV3Scope}
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
@Deprecated
public enum AuthHuaweiScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
BASE_PROFILE("https://www.huawei.com/auth/account/base.profile", "获取用户的基本信息", true),
MOBILE_NUMBER("https://www.huawei.com/auth/account/mobile.number", "获取用户的手机号", false),
ACCOUNTLIST("https://www.huawei.com/auth/account/accountlist", "获取用户的账单列表", false),
/**
* 以下两个 scope 不需要经过华为评估和验证
*/
SCOPE_DRIVE_FILE("https://www.huawei.com/auth/drive.file", "只允许访问由应用程序创建或打开的文件", false),
SCOPE_DRIVE_APPDATA("https://www.huawei.com/auth/drive.appdata", "只允许访问由应用程序创建或打开的文件", false),
/**
* 以下四个 scope 使用前需要向drivekit@huawei.com提交申请
* <p>
* 参考https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides-V5/server-dev-0000001050039664-V5#ZH-CN_TOPIC_0000001050039664__section1618418855716
*/
SCOPE_DRIVE("https://www.huawei.com/auth/drive", "只允许访问由应用程序创建或打开的文件", false),
SCOPE_DRIVE_READONLY("https://www.huawei.com/auth/drive.readonly", "只允许访问由应用程序创建或打开的文件", false),
SCOPE_DRIVE_METADATA("https://www.huawei.com/auth/drive.metadata", "只允许访问由应用程序创建或打开的文件", false),
SCOPE_DRIVE_METADATA_READONLY("https://www.huawei.com/auth/drive.metadata.readonly", "只允许访问由应用程序创建或打开的文件", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,51 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 华为平台 V3 版本 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.16.7
*/
@Getter
@AllArgsConstructor
public enum AuthHuaweiV3Scope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
OPENID("openid", "基础scopev3必选", true),
/**
* {@code scope} 含义{@code description} 为准
*/
BASE_PROFILE("https://www.huawei.com/auth/account/base.profile", "获取用户的基本信息", true),
MOBILE_NUMBER("https://www.huawei.com/auth/account/mobile.number", "获取用户的手机号", false),
ACCOUNTLIST("https://www.huawei.com/auth/account/accountlist", "获取用户的账单列表", false),
/**
* 以下两个 scope 不需要经过华为评估和验证
*/
SCOPE_DRIVE_FILE("https://www.huawei.com/auth/drive.file", "只允许访问由应用程序创建或打开的文件", false),
SCOPE_DRIVE_APPDATA("https://www.huawei.com/auth/drive.appdata", "只允许访问由应用程序创建或打开的文件", false),
/**
* 以下四个 scope 使用前需要向drivekit@huawei.com提交申请
* <p>
* 参考https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides-V5/server-dev-0000001050039664-V5#ZH-CN_TOPIC_0000001050039664__section1618418855716
*/
SCOPE_DRIVE("https://www.huawei.com/auth/drive", "只允许访问由应用程序创建或打开的文件", false),
SCOPE_DRIVE_READONLY("https://www.huawei.com/auth/drive.readonly", "只允许访问由应用程序创建或打开的文件", false),
SCOPE_DRIVE_METADATA("https://www.huawei.com/auth/drive.metadata", "只允许访问由应用程序创建或打开的文件", false),
SCOPE_DRIVE_METADATA_READONLY("https://www.huawei.com/auth/drive.metadata.readonly", "只允许访问由应用程序创建或打开的文件", false),
;
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,26 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 京东平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthJdScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
SNSAPI_BASE("snsapi_base", "基础授权", true);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,28 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 酷家乐平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthKujialeScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
GET_USER_INFO("get_user_info", "获取用户的基本信息", true),
GET_DESIGN("get_design", "获取指定方案详情", false),
GET_BUDGET_LIST("get_budget_list", "获取清单预算概览数据", false);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,28 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Line 平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.16.0
*/
@Getter
@AllArgsConstructor
public enum AuthLineScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
PROFILE("profile", "Get profile details", true),
OPENID("openid", "Get id token", true),
EMAIL("email", "Get email (separate authorization required)", false);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,43 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 领英平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthLinkedinScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
R_LITEPROFILE("r_liteprofile", "Use your name, headline, and photo", true),
R_EMAILADDRESS("r_emailaddress", "Use the primary email address associated with your LinkedIn account", true),
W_MEMBER_SOCIAL("w_member_social", "Post, comment and like posts on your behalf", true),
R_MEMBER_SOCIAL("r_member_social", "Retrieve your posts, comments, likes, and other engagement data", false),
R_AD_CAMPAIGNS("r_ad_campaigns", "View advertising campaigns you manage", false),
R_ADS("r_ads", "Retrieve your advertising accounts", false),
R_ADS_LEADGEN_AUTOMATION("r_ads_leadgen_automation", "Access your Lead Gen Forms and retrieve leads", false),
R_ADS_REPORTING("r_ads_reporting", "Retrieve reporting for your advertising accounts", false),
R_BASICPROFILE("r_basicprofile", "Use your basic profile including your name, photo, headline, and current positions", false),
R_ORGANIZATION_SOCIAL("r_organization_social", "Retrieve your organizations' posts, including any comments, likes and other engagement data", false),
RW_AD_CAMPAIGNS("rw_ad_campaigns", "Manage your advertising campaigns", false),
RW_ADS("rw_ads", "Manage your advertising accounts", false),
RW_COMPANY_ADMIN("rw_company_admin", "For V1 callsManage your organization's page and post updates", false),
RW_DMP_SEGMENTS("rw_dmp_segments", "Create and manage your matched audiences", false),
RW_ORGANIZATION_ADMIN("rw_organization_admin", "Manage your organizations' pages and retrieve reporting data", false),
RW_ORGANIZATION("rw_organization", "For V2 callsManage your organization's page and post updates", false),
W_ORGANIZATION_SOCIAL("w_organization_social", "Post, comment and like posts on your organization's behalf", false),
W_SHARE("w_share", "Post updates to LinkedIn as you", false);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,28 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 小米平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthMiScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
profile("user/profile", "获取用户的基本信息", true),
OPENID("user/openIdV2", "获取用户的OpenID", true),
PHONE_EMAIL("user/phoneAndEmail", "获取用户的手机号和邮箱", true);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,67 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 微软平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthMicrosoftScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
PROFILE("profile", "允许应用查看用户的基本个人资料(名称、图片、用户名称)", true),
EMAIL("email", "允许应用读取用户的主电子邮件地址", true),
OPENID("openid", "允许用户以其工作或学校帐户登录应用,并允许应用查看用户的基本个人资料信息", true),
OFFLINE_ACCESS("offline_access", "允许应用读取和更新用户数据,即使用户当前没有在使用此应用,也不例外", true),
USER_READ("User.Read", "登录并读取用户个人资料", false),
USER_READWRITE("User.ReadWrite", "对用户个人资料的读写权限", false),
USER_READBASIC_ALL("User.ReadBasic.All", "读取所有用户的基本个人资料", false),
USER_READ_ALL("User.Read.All", "读取所有用户的完整个人资料", false),
USER_READWRITE_ALL("User.ReadWrite.All", "读取和写入所有用户的完整个人资料", false),
USER_INVITE_ALL("User.Invite.All", "将来宾用户邀请到组织", false),
USER_EXPORT_ALL("User.Export.All", "导出用户数据", false),
USER_MANAGEIDENTITIES_ALL("User.ManageIdentities.All", "管理所有用户标识", false),
USERACTIVITY_READWRITE_CREATEDBYAPP("UserActivity.ReadWrite.CreatedByApp", "将应用活动读取和写入到用户的活动源", false),
FILES_READ("Files.Read", "允许应用读取登录用户的文件", false),
FILES_READ_ALL("Files.Read.All", "允许应用读取登录用户可以访问的所有文件", false),
FILES_READWRITE("Files.ReadWrite", "允许应用读取、创建、更新和删除登录用户的文件", false),
FILES_READWRITE_ALL("Files.ReadWrite.All", "允许应用读取、创建、更新和删除登录用户可以访问的所有文件", false),
FILES_READWRITE_APPFOLDER("Files.ReadWrite.AppFolder", "允许应用读取、创建、更新和删除应用程序文件夹中的文件", false),
FILES_READ_SELECTED("Files.Read.Selected", "允许应用读取用户选择的文件。在用户选择文件后,应用有几个小时的访问权限", false),
FILES_READWRITE_SELECTED("Files.ReadWrite.Selected", "允许应用读取和写入用户选择的文件。在用户选择文件后,应用有几个小时的访问权限", false),
ORGCONTACT_READ_ALL("OrgContact.Read.All", "允许应用代表已登录用户读取所有组织联系人。 这些联系人由组织管理,不同于用户的个人联系人", false),
MAIL_READ("Mail.Read", "允许应用读取用户邮箱中的电子邮件", false),
MAIL_READBASIC("Mail.ReadBasic", "允许应用读取已登录用户的邮箱,但不读取 body、bodyPreview、uniqueBody、attachments、extensions 和任何扩展属性。 不包含邮件搜索权限", false),
MAIL_READWRITE("Mail.ReadWrite", "允许应用创建、读取、更新和删除用户邮箱中的电子邮件。不包括发送电子邮件的权限", false),
MAIL_READ_SHARED("Mail.Read.Shared", "允许应用读取用户可以访问的邮件,包括用户个人邮件和共享邮件", false),
MAIL_READWRITE_SHARED("Mail.ReadWrite.Shared", "允许应用创建、读取、更新和删除用户有权访问的邮件,包括用户个人邮件和共享邮件。不包括邮件发送权限", false),
MAIL_SEND("Mail.Send", "允许应用以组织用户身份发送邮件", false),
MAIL_SEND_SHARED("Mail.Send.Shared", "允许应用以登录用户身份发送邮件,包括代表他人发送邮件", false),
MAILBOXSETTINGS_READ("MailboxSettings.Read", "允许应用读取用户的邮箱设置。不包括邮件发送权限", false),
MAILBOXSETTINGS_READWRITE("MailboxSettings.ReadWrite", "允许应用创建、读取、更新和删除用户邮箱设置。 不包含直接发送邮件的权限,但允许应用创建能够转发或重定向邮件的规则", false),
NOTES_READ("Notes.Read", "允许应用代表已登录用户读取 OneNote 笔记本和分区标题并创建新的页面、笔记本和分区", false),
NOTES_CREATE("Notes.Create", "允许应用代创建用户 OneNote 笔记本", false),
NOTES_READWRITE("Notes.ReadWrite", "允许应用代表已登录用户读取、共享和修改 OneNote 笔记本", false),
NOTES_READ_ALL("Notes.Read.All", "允许应用读取登录用户在组织中有权访问的 OneNote 笔记本", false),
NOTES_READWRITE_ALL("Notes.ReadWrite.All", "允许应用读取、共享和修改已登录用户在组织中有权访问的 OneNote 笔记本", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,66 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Okta 平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @since 1.16.0
*/
@Getter
@AllArgsConstructor
public enum AuthOktaScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
OPENID("openid", "Signals that a request is an OpenID request.", true),
PROFILE("profile", "The exact data varies based on what profile information you have provided, such as: name, time zone, picture, or birthday.", true),
EMAIL("email", "This allows the app to view your email address.", true),
ADDRESS("address", "This allows the app to view your address, such as: street address, city, state, and zip code.", true),
PHONE("phone", "This allows the app to view your phone number.", true),
OFFLINE_ACCESS("offline_access", "This keeps you signed in to the app, even when you are not using it.", true),
OKTA_USERS_MANAGE("okta.users.manage", "Allows the app to create and manage users and read all profile and credential information for users", false),
OKTA_USERS_READ("okta.users.read", "Allows the app to read any user's profile and credential information", false),
OKTA_USERS_MANAGE_SELF("okta.users.manage.self", "Allows the app to manage the currently signed-in user's profile. Currently only supports user profile attribute updates.", false),
OKTA_USERS_READ_SELF("okta.users.read.self", "Allows the app to read the currently signed-in user's profile and credential information", false),
OKTA_APPS_MANAGE("okta.apps.manage", "Allows the app to create and manage Apps in your Okta organization", false),
OKTA_APPS_READ("okta.apps.read", "Allows the app to read information about Apps in your Okta organization", false),
OKTA_AUTHORIZATIONSERVERS_MANAGE("okta.authorizationServers.manage", "Allows the app to manage authorization servers", false),
OKTA_AUTHORIZATIONSERVERS_READ("okta.authorizationServers.read", "Allows the app to read authorization server information", false),
OKTA_CLIENTS_MANAGE("okta.clients.manage", "Allows the app to manage all OAuth/OIDC clients and to create new clients", false),
OKTA_CLIENTS_READ("okta.clients.read", "Allows the app to read information for all OAuth/OIDC clients", false),
OKTA_CLIENTS_REGISTER("okta.clients.register", "Allows the app to register (create) new OAuth/OIDC clients (but not read information about existing clients)", false),
OKTA_EVENTHOOKS_MANAGE("okta.eventHooks.manage", "Allows the app to create and manage Event Hooks in your Okta organization", false),
OKTA_EVENTHOOKS_READ("okta.eventHooks.read", "Allows the app to read information about Event Hooks in your Okta organization", false),
OKTA_FACTORS_MANAGE("okta.factors.manage", "Allows the app to manage all admin operations for org factors (for example, activate, deactive, read)", false),
OKTA_FACTORS_READ("okta.factors.read", "Allows the app to read org factors information", false),
OKTA_GROUPS_MANAGE("okta.groups.manage", "Allows the app to manage groups in your Okta organization", false),
OKTA_GROUPS_READ("okta.groups.read", "Allows the app to read information about groups and their members in your Okta organization", false),
OKTA_IDPS_MANAGE("okta.idps.manage", "Allows the app to create and manage Identity Providers in your Okta organization", false),
OKTA_IDPS_READ("okta.idps.read", "Allows the app to read information about Identity Providers in your Okta organization", false),
OKTA_INLINEHOOKS_MANAGE("okta.inlineHooks.manage", "Allows the app to create and manage Inline Hooks in your Okta organization.", false),
OKTA_INLINEHOOKS_READ("okta.inlineHooks.read", "Allows the app to read information about Inline Hooks in your Okta organization.", false),
OKTA_LINKEDOBJECTS_MANAGE("okta.linkedObjects.manage", "Allows the app to manage Linked Object definitions in your Okta organization.", false),
OKTA_LINKEDOBJECTS_READ("okta.linkedObjects.read", "Allows the app to read Linked Object definitions in your Okta organization.", false),
OKTA_LOGS_READ("okta.logs.read", "Allows the app to read information about System Log entries in your Okta organization", false),
OKTA_ROLES_MANAGE("okta.roles.manage", "Allows the app to create and manage Administrator Roles in your Okta organization", false),
OKTA_ROLES_READ("okta.roles.read", "Allows the app to read information about Administrator Roles in your Okta organization", false),
OKTA_SCHEMAS_MANAGE("okta.schemas.manage", "Allows the app to create and manage Schemas in your Okta organization", false),
OKTA_SCHEMAS_READ("okta.schemas.read", "Allows the app to read information about Schemas in your Okta organization", false),
OKTA_SESSIONS_MANAGE("okta.sessions.manage", "Allows the app to manage all sessions in your Okta organization", false),
OKTA_SESSIONS_READ("okta.sessions.read", "Allows the app to read all sessions in your Okta organization", false),
OKTA_TEMPLATES_MANAGE("okta.templates.manage", "Allows the app to manage all custom templates in your Okta organization", false),
OKTA_TEMPLATES_READ("okta.templates.read", "Allows the app to read all custom templates in your Okta organization", false),
OKTA_TRUSTEDORIGINS_MANAGE("okta.trustedOrigins.manage", "Allows the app to manage all Trusted Origins in your Okta organization", false),
OKTA_TRUSTEDORIGINS_READ("okta.trustedOrigins.read", "Allows the app to read all Trusted Origins in your Okta organization", false),
OKTA_POLICIES_MANAGE("okta.policies.manage", "Allows the app to manage Policies in your Okta organization", false),
OKTA_POLICIES_READ("okta.policies.read", "Allows the app to read information about Policies in your Okta organization", false),;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,30 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Pinterest 平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthPinterestScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
READ_PUBLIC("read_public", "Use GET method on a users Pins, boards.", true),
WRITE_PUBLIC("write_public", "Use PATCH, POST and DELETE methods on a users Pins and boards.", false),
READ_RELATIONSHIPS("read_relationships", "Use GET method on a users follows and followers (on boards, users and interests).", false),
WRITE_RELATIONSHIPS("write_relationships", "Use PATCH, POST and DELETE methods on a users follows and followers (on boards, users and interests).", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,33 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Gitee 平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthProginnScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
BASIC("basic", "访问用户的基本信息", true),
/**
* 以上 scope 需要单独向程序员客栈平台申请否则不可使用
*/
email("email", "获取用户的邮箱", false),
realname("realname", "获取用户的真实姓名", false),
cellphone("cellphone", "获取用户的手机号码", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,35 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* QQ 平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthQqScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
GET_USER_INFO("get_user_info", "获取登录用户的昵称、头像、性别", true),
/**
* 以下 scope 需要申请http://wiki.connect.qq.com/openapi%e6%9d%83%e9%99%90%e7%94%b3%e8%af%b7
*/
GET_VIP_INFO("get_vip_info", "获取QQ会员的基本信息", false),
GET_VIP_RICH_INFO("get_vip_rich_info", "获取QQ会员的高级信息", false),
LIST_ALBUM("list_album", "获取用户QQ空间相册列表", false),
UPLOAD_PIC("upload_pic", "上传一张照片到QQ空间相册", false),
ADD_ALBUM("add_album", "在用户的空间相册里,创建一个新的个人相册", false),
LIST_PHOTO("list_photo", "获取用户QQ空间相册中的照片列表", false);
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,55 @@
package me.zhyd.oauth.enums.scope;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 人人平台 OAuth 授权范围
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.0.0
*/
@Getter
@AllArgsConstructor
public enum AuthRenrenScope implements AuthScope {
/**
* {@code scope} 含义{@code description} 为准
*/
READ_USER_BLOG("read_user_blog", "获取用户日志时需要用户授予的权限。", false),
READ_USER_CHECKIN("read_user_checkin", "获取用户报到信息时需要用户授予的权限。", false),
READ_USER_FEED("read_user_feed", "获取用户新鲜事时需要用户授予的权限。", false),
READ_USER_GUESTBOOK("read_user_guestbook", "获取用户留言板时需要用户授予的权限。", false),
READ_USER_INVITATION("read_user_invitation", "获取用户被邀请的状况时需要用户授予的权限。", false),
READ_USER_LIKE_HISTORY("read_user_like_history", "获取用户喜欢的历史信息时需要用户授予的权限。", false),
READ_USER_MESSAGE("read_user_message", "获取用户站内信时需要用户授予的权限。", false),
READ_USER_NOTIFICATION("read_user_notification", "获取用户已收到的通知时需要用户授予的权限。", false),
READ_USER_PHOTO("read_user_photo", "获取用户相册相关信息时需要用户授予的权限。", false),
READ_USER_STATUS("read_user_status", "获取用户状态相关信息时需要用户授予的权限。", false),
READ_USER_ALBUM("read_user_album", "获取用户相册相关信息时需要用户授予的权限。", false),
READ_USER_COMMENT("read_user_comment", "获取用户评论相关信息时需要用户授予的权限。", false),
READ_USER_SHARE("read_user_share", "获取用户分享相关信息时需要用户授予的权限。", false),
READ_USER_REQUEST("read_user_request", "获取用户好友请求、圈人请求等信息时需要用户授予的权限。", false),
PUBLISH_BLOG("publish_blog", "以用户身份发布日志时需要用户授予的权限。", false),
PUBLISH_CHECKIN("publish_checkin", "以用户身份发布报到时需要用户授予的权限。", false),
PUBLISH_FEED("publish_feed", "以用户身份发送新鲜事时需要用户授予的权限。", false),
PUBLISH_SHARE("publish_share", "以用户身份发送分享时需要用户授予的权限。", false),
WRITE_GUESTBOOK("write_guestbook", "以用户身份进行留言时需要用户授予的权限。", false),
SEND_INVITATION("send_invitation", "以用户身份发送邀请时需要用户授予的权限。", false),
SEND_REQUEST("send_request", "以用户身份发送好友申请、圈人请求等时需要用户授予的权限。", false),
SEND_MESSAGE("send_message", "以用户身份发送站内信时需要用户授予的权限。", false),
SEND_NOTIFICATION("send_notification", "以用户身份发送通知user_to_user时需要用户授予的权限。", false),
PHOTO_UPLOAD("photo_upload", "以用户身份上传照片时需要用户授予的权限。", false),
STATUS_UPDATE("status_update", "以用户身份发布状态时需要用户授予的权限。", false),
CREATE_ALBUM("create_album", "以用户身份发布相册时需要用户授予的权限。", false),
PUBLISH_COMMENT("publish_comment", "以用户身份发布评论时需要用户授予的权限。", false),
OPERATE_LIKE("operate_like", "以用户身份执行喜欢操作时需要用户授予的权限。", false),
ADMIN_PAGE("admin_page", "以用户的身份,管理其可以管理的公共主页的权限。", false),
;
private final String scope;
private final String description;
private final boolean isDefault;
}

View File

@ -0,0 +1,25 @@
package me.zhyd.oauth.enums.scope;
/**
* 各个平台 scope 类的统一接口
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0.0
* @since 1.15.7
*/
public interface AuthScope {
/**
* 获取字符串 {@code scope}对应为各平台实际使用的 {@code scope}
*
* @return String
*/
String getScope();
/**
* 判断当前 {@code scope} 是否为各平台默认启用的
*
* @return boolean
*/
boolean isDefault();
}

Some files were not shown because too many files have changed in this diff Show More