📝 更新文档
This commit is contained in:
@@ -122,6 +122,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
|
||||
```java
|
||||
import me.zhyd.oauth.config.AuthConfig;
|
||||
import me.zhyd.oauth.request.AuthAlipayRequest;
|
||||
import me.zhyd.oauth.model.AuthCallback;
|
||||
import me.zhyd.oauth.request.AuthRequest;
|
||||
import me.zhyd.oauth.utils.AuthStateUtils;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -143,9 +144,9 @@ public class RestAuthController {
|
||||
}
|
||||
|
||||
@RequestMapping("/callback")
|
||||
public Object login(String code) {
|
||||
public Object login(AuthCallback callback) {
|
||||
AuthRequest authRequest = getAuthRequest();
|
||||
return authRequest.login(code);
|
||||
return authRequest.login(callback);
|
||||
}
|
||||
|
||||
private AuthRequest getAuthRequest() {
|
||||
|
||||
@@ -65,6 +65,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
|
||||
```java
|
||||
import me.zhyd.oauth.config.AuthConfig;
|
||||
import me.zhyd.oauth.request.AuthGiteeRequest;
|
||||
import me.zhyd.oauth.model.AuthCallback;
|
||||
import me.zhyd.oauth.request.AuthRequest;
|
||||
import me.zhyd.oauth.utils.AuthStateUtils;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -86,9 +87,9 @@ public class RestAuthController {
|
||||
}
|
||||
|
||||
@RequestMapping("/callback")
|
||||
public Object login(String code) {
|
||||
public Object login(AuthCallback callback) {
|
||||
AuthRequest authRequest = getAuthRequest();
|
||||
return authRequest.login(code);
|
||||
return authRequest.login(callback);
|
||||
}
|
||||
|
||||
private AuthRequest getAuthRequest() {
|
||||
|
||||
@@ -62,6 +62,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
|
||||
```java
|
||||
import me.zhyd.oauth.config.AuthConfig;
|
||||
import me.zhyd.oauth.request.AuthGithubRequest;
|
||||
import me.zhyd.oauth.model.AuthCallback;
|
||||
import me.zhyd.oauth.request.AuthRequest;
|
||||
import me.zhyd.oauth.utils.AuthStateUtils;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -83,9 +84,9 @@ public class RestAuthController {
|
||||
}
|
||||
|
||||
@RequestMapping("/callback")
|
||||
public Object login(String code) {
|
||||
public Object login(AuthCallback callback) {
|
||||
AuthRequest authRequest = getAuthRequest();
|
||||
return authRequest.login(code);
|
||||
return authRequest.login(callback);
|
||||
}
|
||||
|
||||
private AuthRequest getAuthRequest() {
|
||||
|
||||
@@ -81,6 +81,7 @@ String authorizeUrl = authRequest.authorize(String state, String scopeStr);
|
||||
```java
|
||||
import me.zhyd.oauth.config.AuthConfig;
|
||||
import me.zhyd.oauth.request.AuthKujialeRequest;
|
||||
import me.zhyd.oauth.model.AuthCallback;
|
||||
import me.zhyd.oauth.request.AuthRequest;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -101,10 +102,10 @@ public class RestAuthController {
|
||||
}
|
||||
|
||||
@RequestMapping("/callback")
|
||||
public Object login(String code, String state) {
|
||||
public Object login(AuthCallback callback) {
|
||||
AuthRequest authRequest = getAuthRequest();
|
||||
//此处如果对安全性有要求,请校验state参数
|
||||
return authRequest.login(code);
|
||||
return authRequest.login(callback);
|
||||
}
|
||||
|
||||
private AuthRequest getAuthRequest() {
|
||||
|
||||
@@ -55,6 +55,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
|
||||
```java
|
||||
import me.zhyd.oauth.config.AuthConfig;
|
||||
import me.zhyd.oauth.request.AuthQqRequest;
|
||||
import me.zhyd.oauth.model.AuthCallback;
|
||||
import me.zhyd.oauth.request.AuthRequest;
|
||||
import me.zhyd.oauth.utils.AuthStateUtils;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -76,9 +77,9 @@ public class RestAuthController {
|
||||
}
|
||||
|
||||
@RequestMapping("/callback")
|
||||
public Object login(String code) {
|
||||
public Object login(AuthCallback callback) {
|
||||
AuthRequest authRequest = getAuthRequest();
|
||||
return authRequest.login(code);
|
||||
return authRequest.login(callback);
|
||||
}
|
||||
|
||||
private AuthRequest getAuthRequest() {
|
||||
|
||||
@@ -80,6 +80,7 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
|
||||
```java
|
||||
import me.zhyd.oauth.config.AuthConfig;
|
||||
import me.zhyd.oauth.request.AuthWeChatOpenRequest;
|
||||
import me.zhyd.oauth.model.AuthCallback;
|
||||
import me.zhyd.oauth.request.AuthRequest;
|
||||
import me.zhyd.oauth.utils.AuthStateUtils;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -101,9 +102,9 @@ public class RestAuthController {
|
||||
}
|
||||
|
||||
@RequestMapping("/callback")
|
||||
public Object login(String code) {
|
||||
public Object login(AuthCallback callback) {
|
||||
AuthRequest authRequest = getAuthRequest();
|
||||
return authRequest.login(code);
|
||||
return authRequest.login(callback);
|
||||
}
|
||||
|
||||
private AuthRequest getAuthRequest() {
|
||||
|
||||
@@ -64,6 +64,8 @@ String authorizeUrl = authRequest.authorize(AuthStateUtils.createState());
|
||||
```java
|
||||
import me.zhyd.oauth.config.AuthConfig;
|
||||
import me.zhyd.oauth.request.AuthWeiboRequest;
|
||||
import me.zhyd.oauth.model.AuthCallback;
|
||||
import me.zhyd.oauth.model.AuthToken;
|
||||
import me.zhyd.oauth.request.AuthRequest;
|
||||
import me.zhyd.oauth.utils.AuthStateUtils;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -85,9 +87,9 @@ public class RestAuthController {
|
||||
}
|
||||
|
||||
@RequestMapping("/callback")
|
||||
public Object login(String code) {
|
||||
public Object login(AuthCallback callback) {
|
||||
AuthRequest authRequest = getAuthRequest();
|
||||
return authRequest.login(code);
|
||||
return authRequest.login(callback);
|
||||
}
|
||||
|
||||
@RequestMapping("/revoke/{token}")
|
||||
|
||||
Reference in New Issue
Block a user