Skip to content

Commit 0984865

Browse files
committed
Add comment to explain why padding is removed.
Change-Id: I0882e0c5d99310b179ace493b937669520626263
1 parent 0dd70a0 commit 0984865

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cab-token-generator/java/com/google/auth/credentialaccessboundary/ClientSideCredentialAccessBoundaryFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ public AccessToken generateToken(CredentialAccessBoundary accessBoundary)
206206

207207
byte[] encryptedRestrictions = this.encryptRestrictions(rawRestrictions, sessionKey);
208208

209+
// withoutPadding() is used to stay consistent with server-side CAB
210+
// withoutPadding() avoids additional URL encoded token issues (i.e. extra equal signs `=` in the path)
209211
String tokenValue =
210212
intermediateToken + "." + Base64.getUrlEncoder().withoutPadding().encodeToString(encryptedRestrictions);
211213

0 commit comments

Comments
 (0)