Repository navigation
Use org.keycloak.common.util.Base64Url to encode/decode clientID - #15736
Conversation
There was a problem hiding this comment.
Istn't the .replace("=", "");missing here?
There was a problem hiding this comment.
no, as the the method already take the part before the first "="
(see comment)
public static String encodeBase64ToBase64Url(String base64) {
String s = base64.split("=")[0]; // Remove any trailing '='s
s = s.replace('+', '-'); // 62nd char of encoding
s = s.replace('/', '_'); // 63rd char of encoding
return s;
}
There was a problem hiding this comment.
You are right, I haven't checked that. I just compared it to https://github.com/keycloak/keycloak/pull/15735/files but apparently standard Java does not remove trailing =?
ee9f198 to
764d8a6
Compare
|
Pinging @hmlnarik - I'm starting to review this. |
|
Hi @douph1 - could you please update the initial comment/description of this PR to not include backticks? When you do this, GitHub should link this PR to the original issue as "fix" would then be recognized as a keyword, see https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue Thanks! |
ahus1
left a comment
There was a problem hiding this comment.
I reviewed the change and it looks good to me. Thanks for adding another unit test for me. All builds are green, approving it.
|
Hi @hmlnarik - this IMHO ready to be merged. As you've been involved in the original issue, I'd ask you to merge this. Thanks! |


fix #15734
related #10227 #10231