💩 去掉非强制的依赖项
This commit is contained in:
@@ -4,7 +4,7 @@ import me.zhyd.oauth.config.AuthConfig;
|
||||
import me.zhyd.oauth.request.*;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
|
||||
@@ -16,15 +16,12 @@ import javax.servlet.http.HttpServletResponse;
|
||||
public class AuthRequestTest {
|
||||
|
||||
@Test
|
||||
public void giteeTest() {
|
||||
HttpServletResponse response = null;
|
||||
public void giteeTest() throws IOException {
|
||||
AuthRequest authRequest = new AuthGiteeRequest(AuthConfig.builder()
|
||||
.clientId("clientId")
|
||||
.clientSecret("clientSecret")
|
||||
.redirectUri("redirectUri")
|
||||
.build());
|
||||
// 自动跳转到授权页面
|
||||
authRequest.authorize(response);
|
||||
// 返回授权页面,可自行调整
|
||||
authRequest.authorize();
|
||||
// 授权登录后会返回一个code,用这个code进行登录
|
||||
@@ -32,15 +29,12 @@ public class AuthRequestTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void githubTest() {
|
||||
HttpServletResponse response = null;
|
||||
public void githubTest() throws IOException {
|
||||
AuthRequest authRequest = new AuthGithubRequest(AuthConfig.builder()
|
||||
.clientId("clientId")
|
||||
.clientSecret("clientSecret")
|
||||
.redirectUri("redirectUri")
|
||||
.build());
|
||||
// 自动跳转到授权页面
|
||||
authRequest.authorize(response);
|
||||
// 返回授权页面,可自行调整
|
||||
authRequest.authorize();
|
||||
// 授权登录后会返回一个code,用这个code进行登录
|
||||
@@ -48,15 +42,12 @@ public class AuthRequestTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void weiboTest() {
|
||||
HttpServletResponse response = null;
|
||||
public void weiboTest() throws IOException {
|
||||
AuthRequest authRequest = new AuthWeiboRequest(AuthConfig.builder()
|
||||
.clientId("clientId")
|
||||
.clientSecret("clientSecret")
|
||||
.redirectUri("redirectUri")
|
||||
.build());
|
||||
// 自动跳转到授权页面
|
||||
authRequest.authorize(response);
|
||||
// 返回授权页面,可自行调整
|
||||
authRequest.authorize();
|
||||
// 授权登录后会返回一个code,用这个code进行登录
|
||||
@@ -65,14 +56,11 @@ public class AuthRequestTest {
|
||||
|
||||
@Test
|
||||
public void dingdingTest() {
|
||||
HttpServletResponse response = null;
|
||||
AuthRequest authRequest = new AuthDingTalkRequest(AuthConfig.builder()
|
||||
.clientId("dingoa2q6o3fomfk6vdqzy")
|
||||
.clientSecret("d5w75-R-yNtQsq_Ya_r50gOsKOy9WlmrlUOJkUJXKvsQp7NDPRHsj0epJriiN3yO")
|
||||
.redirectUri("http://61.149.7.121:8443/oauth/dingtalk/callback")
|
||||
.build());
|
||||
// 自动跳转到授权页面
|
||||
// authRequest.authorize(response);
|
||||
// 返回授权页面,可自行调整
|
||||
String url = authRequest.authorize();
|
||||
System.out.println(url);
|
||||
|
||||
Reference in New Issue
Block a user