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

🎨 完成小米的自定义 scope

This commit is contained in:
yadong.zhang
2020-07-04 01:49:06 +08:00
parent df11fcbd4c
commit 6354182335
2 changed files with 50 additions and 2 deletions
@@ -1,19 +1,20 @@
package me.zhyd.oauth.request;
import com.alibaba.fastjson.JSONObject;
import me.zhyd.oauth.utils.HttpUtils;
import com.xkcoding.http.constants.Constants;
import me.zhyd.oauth.cache.AuthStateCache;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.config.AuthDefaultSource;
import me.zhyd.oauth.enums.AuthResponseStatus;
import me.zhyd.oauth.enums.AuthUserGender;
import me.zhyd.oauth.enums.scope.AuthMiScope;
import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.log.Log;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.utils.HttpUtils;
import me.zhyd.oauth.utils.UrlBuilder;
import java.text.MessageFormat;
@@ -128,7 +129,7 @@ public class AuthMiRequest extends AuthDefaultRequest {
.queryParam("response_type", "code")
.queryParam("client_id", config.getClientId())
.queryParam("redirect_uri", config.getRedirectUri())
.queryParam("scope", "user/profile%20user/openIdV2%20user/phoneAndEmail")
.queryParam("scope", this.getScopes(" ", true, AuthMiScope.getDefaultScopes()))
.queryParam("skip_confirm", "false")
.queryParam("state", getRealState(state))
.build();