Compare commits
7 Commits
v1.15.7-be
...
v1.15.7-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b71b081c96 | ||
|
|
6b00783cd9 | ||
|
|
2723f0dc3d | ||
|
|
abbfb73337 | ||
|
|
960892eec3 | ||
|
|
4a6216f7d9 | ||
|
|
ce689362ac |
@@ -6,7 +6,7 @@
|
||||
</p>
|
||||
<p align="center">
|
||||
<a target="_blank" href="https://search.maven.org/search?q=JustAuth">
|
||||
<img src="https://img.shields.io/badge/Maven%20Central-1.15.7%20beta.1-blue" ></img>
|
||||
<img src="https://img.shields.io/badge/Maven%20Central-1.15.7%20beta.3-blue" ></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>
|
||||
@@ -15,7 +15,7 @@
|
||||
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" ></img>
|
||||
</a>
|
||||
<a target="_blank" href="https://apidoc.gitee.com/yadong.zhang/JustAuth/" title="API文档">
|
||||
<img src="https://img.shields.io/badge/Api%20Docs-1.15.7%20beta.1-orange" ></img>
|
||||
<img src="https://img.shields.io/badge/Api%20Docs-1.15.7%20beta.3-orange" ></img>
|
||||
</a>
|
||||
<a target="_blank" href="https://justauth.wiki" title="参考文档">
|
||||
<img src="https://img.shields.io/badge/Docs-latest-blueviolet.svg" ></img>
|
||||
@@ -97,7 +97,7 @@ These artifacts are available from Maven Central:
|
||||
<dependency>
|
||||
<groupId>me.zhyd.oauth</groupId>
|
||||
<artifactId>JustAuth</artifactId>
|
||||
<version>1.15.7-beta.1</version>
|
||||
<version>1.15.7-beta.2</version>
|
||||
</dependency>
|
||||
```
|
||||
- Using JustAuth
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</p>
|
||||
<p align="center">
|
||||
<a target="_blank" href="https://search.maven.org/search?q=JustAuth">
|
||||
<img src="https://img.shields.io/badge/Maven%20Central-1.15.7%20beta.1-blue" ></img>
|
||||
<img src="https://img.shields.io/badge/Maven%20Central-1.15.7%20beta.3-blue" ></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>
|
||||
@@ -15,7 +15,7 @@
|
||||
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" ></img>
|
||||
</a>
|
||||
<a target="_blank" href="https://apidoc.gitee.com/yadong.zhang/JustAuth/" title="API文档">
|
||||
<img src="https://img.shields.io/badge/Api%20Docs-1.15.7%20beta.1-orange" ></img>
|
||||
<img src="https://img.shields.io/badge/Api%20Docs-1.15.7%20beta.3-orange" ></img>
|
||||
</a>
|
||||
<a target="_blank" href="https://justauth.wiki" title="参考文档">
|
||||
<img src="https://img.shields.io/badge/Docs-latest-blueviolet.svg" ></img>
|
||||
@@ -107,7 +107,7 @@ JustAuth 集成了诸如:Github、Gitee、支付宝、新浪微博、微信、
|
||||
<dependency>
|
||||
<groupId>me.zhyd.oauth</groupId>
|
||||
<artifactId>JustAuth</artifactId>
|
||||
<version>1.15.7-beta.1</version>
|
||||
<version>1.15.7-beta.3</version>
|
||||
</dependency>
|
||||
```
|
||||
- 调用api
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.15.7-beta.1
|
||||
1.15.7-beta.3
|
||||
|
||||
9
pom.xml
9
pom.xml
@@ -6,15 +6,12 @@
|
||||
|
||||
<groupId>me.zhyd.oauth</groupId>
|
||||
<artifactId>JustAuth</artifactId>
|
||||
<version>1.15.7-beta.1</version>
|
||||
<version>1.15.7-beta.3</version>
|
||||
|
||||
<name>JustAuth</name>
|
||||
<url>https://gitee.com/yadong.zhang/JustAuth</url>
|
||||
<description>
|
||||
史上最全的整合第三方登录的开源库。目前已支持Github、Gitee、微博、钉钉、百度、Coding、腾讯云开发者平台、OSChina、支付宝、
|
||||
QQ、微信开放平台、微信公众平台、淘宝、Google、Facebook、抖音、领英、小米、微软、今日头条、Teambition、StackOverflow、Pinterest、人人、华为、
|
||||
企业微信、酷家乐、Gitlab、美团、饿了么和推特等第三方平台的授权登录。
|
||||
Login, so easy!
|
||||
小而全而美的第三方登录开源组件。目前已支持Github、Gitee、微博、钉钉、百度、Coding、腾讯云开发者平台、OSChina、支付宝、QQ、微信、淘宝、Google、Facebook、抖音、领英、小米、微软、今日头条、Teambition、StackOverflow、Pinterest、人人、华为、企业微信、酷家乐、Gitlab、美团、饿了么和推特等第三方平台的授权登录。 Login, so easy!
|
||||
</description>
|
||||
|
||||
<licenses>
|
||||
@@ -63,7 +60,7 @@
|
||||
<simple-http.version>1.0.2</simple-http.version>
|
||||
<lombok-version>1.18.10</lombok-version>
|
||||
<junit-version>4.11</junit-version>
|
||||
<fastjson-version>1.2.71</fastjson-version>
|
||||
<fastjson-version>1.2.73</fastjson-version>
|
||||
<alipay-sdk-version>4.8.10.ALL</alipay-sdk-version>
|
||||
<jacoco-version>0.8.2</jacoco-version>
|
||||
</properties>
|
||||
|
||||
@@ -30,7 +30,7 @@ public enum AuthCacheScheduler {
|
||||
this.scheduler = new ScheduledThreadPoolExecutor(10, r -> new Thread(r, String.format("JustAuth-Task-%s", cacheTaskNumber.getAndIncrement())));
|
||||
}
|
||||
|
||||
private void shutdown() {
|
||||
public void shutdown() {
|
||||
if (null != scheduler) {
|
||||
this.scheduler.shutdown();
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class AuthMicrosoftRequest extends AuthDefaultRequest {
|
||||
.queryParam("client_id", config.getClientId())
|
||||
.queryParam("client_secret", config.getClientSecret())
|
||||
.queryParam("grant_type", "authorization_code")
|
||||
.queryParam("scope", "offline_access user.read mail.read")
|
||||
.queryParam("scope", this.getScopes(" ", true, AuthScopeUtils.getDefaultScopes(AuthMicrosoftScope.values())))
|
||||
.queryParam("redirect_uri", config.getRedirectUri())
|
||||
.build();
|
||||
}
|
||||
@@ -172,7 +172,7 @@ public class AuthMicrosoftRequest extends AuthDefaultRequest {
|
||||
.queryParam("client_secret", config.getClientSecret())
|
||||
.queryParam("refresh_token", refreshToken)
|
||||
.queryParam("grant_type", "refresh_token")
|
||||
.queryParam("scope", "user.read%20mail.read")
|
||||
.queryParam("scope", this.getScopes(" ", true, AuthScopeUtils.getDefaultScopes(AuthMicrosoftScope.values())))
|
||||
.queryParam("redirect_uri", config.getRedirectUri())
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -124,8 +124,8 @@ public class AuthWeChatMpRequest extends AuthDefaultRequest {
|
||||
.queryParam("appid", config.getClientId())
|
||||
.queryParam("redirect_uri", GlobalAuthUtils.urlEncode(config.getRedirectUri()))
|
||||
.queryParam("response_type", "code")
|
||||
.queryParam("state", getRealState(state).concat("#wechat_redirect"))
|
||||
.queryParam("scope", this.getScopes(",", false, AuthScopeUtils.getDefaultScopes(AuthWechatMpScope.values())))
|
||||
.queryParam("state", getRealState(state).concat("#wechat_redirect"))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package me.zhyd.oauth.request;
|
||||
|
||||
import me.zhyd.oauth.config.AuthConfig;
|
||||
import me.zhyd.oauth.utils.AuthStateUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
public class AuthWeChatMpRequestTest {
|
||||
|
||||
@Test
|
||||
public void authorize() {
|
||||
|
||||
AuthRequest request = new AuthWeChatMpRequest(AuthConfig.builder()
|
||||
.clientId("a")
|
||||
.clientSecret("a")
|
||||
.redirectUri("https://www.justauth.cn")
|
||||
.build());
|
||||
System.out.println(request.authorize(AuthStateUtils.createState()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user