Merge pull request #166 from christxlx/master

fix: bug 58-63 scope在微软最新的文档中要求必须用空格隔开,form构建时候空格会被强制转换为%20,所以此处重新覆盖
This commit is contained in:
yadong.zhang 2023-12-03 21:04:10 +08:00 committed by GitHub
commit 4d2a110fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);