1
0
mirror of synced 2025-12-26 17:38:11 +08:00

Compare commits

...

4 Commits

Author SHA1 Message Date
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
7 changed files with 28 additions and 9 deletions

View File

@@ -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.2-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>
@@ -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

View File

@@ -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.2-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>
@@ -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.2</version>
</dependency>
```
- 调用api

View File

@@ -1 +1 @@
1.15.7-beta.1
1.15.7-beta.2

View File

@@ -6,7 +6,7 @@
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
<version>1.15.7-beta.1</version>
<version>1.15.7-beta.2</version>
<name>JustAuth</name>
<url>https://gitee.com/yadong.zhang/JustAuth</url>

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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()));
}
}