mirror of
https://gitee.com/yadong.zhang/JustAuth.git
synced 2025-12-06 08:48:27 +08:00
Merge pull request #166 from christxlx/master
fix: bug 58-63 scope在微软最新的文档中要求必须用空格隔开,form构建时候空格会被强制转换为%20,所以此处重新覆盖
This commit is contained in:
commit
4d2a110fea
@ -54,6 +54,13 @@ public abstract class AbstractAuthMicrosoftRequest extends AuthDefaultRequest {
|
|||||||
|
|
||||||
Map<String, String> form = MapUtil.parseStringToMap(accessTokenUrl, false);
|
Map<String, String> form = MapUtil.parseStringToMap(accessTokenUrl, false);
|
||||||
|
|
||||||
|
//scope在微软最新的文档中要求必须用空格隔开,form构建时候空格会被强制转换为%20,所以此处重新覆盖
|
||||||
|
String scope = form.get("scope");
|
||||||
|
if (scope != null){
|
||||||
|
String replace = scope.replaceAll("%20"," ");
|
||||||
|
form.put("scope",replace);
|
||||||
|
}
|
||||||
|
|
||||||
String response = new HttpUtils(config.getHttpConfig()).post(accessTokenUrl, form, httpHeader, false).getBody();
|
String response = new HttpUtils(config.getHttpConfig()).post(accessTokenUrl, form, httpHeader, false).getBody();
|
||||||
JSONObject accessTokenObject = JSONObject.parseObject(response);
|
JSONObject accessTokenObject = JSONObject.parseObject(response);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user