Skip to content

Commit

Permalink
Merge pull request #166 from christxlx/master
Browse files Browse the repository at this point in the history
fix: bug 58-63 scope在微软最新的文档中要求必须用空格隔开,form构建时候空格会被强制转换为%20,所以此处重新覆盖
  • Loading branch information
zhangyd-c authored Dec 3, 2023
2 parents 2ef8298 + 80b59fc commit 4d2a110
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ private AuthToken getToken(String accessTokenUrl) {

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();
JSONObject accessTokenObject = JSONObject.parseObject(response);

Expand Down

0 comments on commit 4d2a110

Please sign in to comment.