Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Lines Causes Decoding Failure in MTLS Client Authenticator #20229

Open
Shenali-SJ opened this issue Apr 19, 2024 · 0 comments
Open

New Lines Causes Decoding Failure in MTLS Client Authenticator #20229

Shenali-SJ opened this issue Apr 19, 2024 · 0 comments
Assignees
Labels

Comments

@Shenali-SJ
Copy link
Contributor

Description

In mTLS client authenticator, base64 decoding process of the client certificate fails due to presence of new lines. We are currently utilizing base64 class in the java.util package and it is not capable of processing new lines.

Error Message

<ns1:XMLFault xmlns:ns1="http://cxf.apache.org/bindings/xformat"><ns1:faultstring xmlns:ns1="http://cxf.apache.org/bindings/xformat">java.lang.IllegalArgumentException: Illegal base64 character 7b</ns1:faultstring></ns1:XMLFault>

Suggested Fix

Add the logic to remove new lines from the client certificate before the decoding functionality [1].

[1] - https://github.com/wso2-extensions/identity-oauth-addons/blob/4d30af9cdf22aee6c5182372ace5da5a21b88fca/component/org.wso2.carbon.identity.oauth2.token.handler.clientauth.mutualtls/src/main/java/org/wso2/carbon/identity/oauth2/token/handler/clientauth/mutualtls/MutualTLSClientAuthenticator.java#L280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants