AzureActiveDirectoryService: Use UrlDecoder for base64 decoding Bug: https://github.com/davido/gerrit-oauth-provider/issues/161 Change-Id: I6a803d30d4272dfbd1a70402a1dff23302317adb
diff --git a/src/main/java/com/googlesource/gerrit/plugins/oauth/AzureActiveDirectoryService.java b/src/main/java/com/googlesource/gerrit/plugins/oauth/AzureActiveDirectoryService.java index 81dc53f..49077fb 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/oauth/AzureActiveDirectoryService.java +++ b/src/main/java/com/googlesource/gerrit/plugins/oauth/AzureActiveDirectoryService.java
@@ -236,7 +236,7 @@ // Extract the payload part from the JWT token (header.payload.signature) by retrieving // tokenParts[1]. return gson.fromJson( - new String(Base64.getDecoder().decode(tokenParts[1]), StandardCharsets.UTF_8), + new String(Base64.getUrlDecoder().decode(tokenParts[1]), StandardCharsets.UTF_8), JsonObject.class); } }