👽 修改login方法的参数为AuthCallback,封装回调返回的参数、支持state参数、增加code和state参数校验
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user