Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use MIME decoder instead of the default one to replace deprecated Base64 class#45279

Merged
ahus1 merged 1 commit intokeycloak:mainfrom
rmartinc:issue-45226
Jan 9, 2026
Merged

Use MIME decoder instead of the default one to replace deprecated Base64 class#45279
ahus1 merged 1 commit intokeycloak:mainfrom
rmartinc:issue-45226

Conversation

@rmartinc
Copy link
Contributor

@rmartinc rmartinc commented Jan 8, 2026

Closes #45226

This is a fix for a regression caused by #43370. The old Base64 class skips some characters (\n, \t and \r and space itself are -5 in _STANDARD_DECODABET), that are just not considered for decoding (see here). So the Base64 class is more like the mime instead of the normal decoder. This PR changes the the calls that where changed in the previous PR for getDecoder, this time for getMimeDecoder. I have added a unit test to check a MIME encoded saml response is also parsed successfully.

@ahus1
Copy link
Member

ahus1 commented Jan 8, 2026

@rmartinc: I'm sorry for this regression. I also reviewed the original PR. Thanks for fixing it!

cc: @pruivo, @tkyjovsk

@mposolda mposolda self-assigned this Jan 9, 2026
Copy link
Contributor

@mposolda mposolda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rmartinc Thanks a lot for fixing this, LGTM!

@ahus1 @tkyjovsk @pruivo Are you OK with merging this PR, or do you want to review as well?

@ahus1
Copy link
Member

ahus1 commented Jan 9, 2026

@mposolda - I'm reviewing it just now and I'm ok to merge it.

@ahus1 ahus1 merged commit 1aa1621 into keycloak:main Jan 9, 2026
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure when decrypting SAML Response since 26.5.0

3 participants