1
0
mirror of synced 2026-05-22 21:53:18 +00:00

👽 修改login方法的参数为AuthCallback,封装回调返回的参数、支持state参数、增加code和state参数校验

This commit is contained in:
yadong.zhang
2019-06-27 19:39:21 +08:00
parent 9941ce7e2a
commit ac4ede74bf
31 changed files with 187 additions and 107 deletions
@@ -7,10 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.config.AuthSource;
import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.model.AuthUserGender;
import me.zhyd.oauth.model.*;
import me.zhyd.oauth.utils.UrlBuilder;
import java.util.HashMap;
@@ -29,9 +26,9 @@ public class AuthMicrosoftRequest extends BaseAuthRequest {
}
@Override
protected AuthToken getAccessToken(String code) {
protected AuthToken getAccessToken(AuthCallback authCallback) {
String accessTokenUrl = UrlBuilder.getMicrosoftAccessTokenUrl(config.getClientId(), config.getClientSecret(), config
.getRedirectUri(), code);
.getRedirectUri(), authCallback.getCode());
return getToken(accessTokenUrl);
}