1
0
mirror of synced 2026-02-19 02:27:46 +08:00

增加微信登录支持

This commit is contained in:
Yangkai.Shen
2019-05-17 15:26:31 +08:00
parent 2e0262ed7e
commit 87c2a1b2cd
6 changed files with 206 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package me.zhyd.oauth;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.request.*;
import org.junit.Test;
@@ -114,4 +115,17 @@ public class AuthRequestTest {
// 授权登录后会返回一个code用这个code进行登录
authRequest.login("code");
}
@Test
public void wechatTest() {
AuthRequest authRequest = new AuthWeChatRequest(AuthConfig.builder()
.clientId("clientId")
.clientSecret("clientSecret")
.redirectUri("redirectUri")
.build());
// 返回授权页面,可自行调整
String url = authRequest.authorize();
// 授权登录后会返回一个code用这个code进行登录
AuthResponse login = authRequest.login("code");
}
}