You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug] 'Illegal base64 character 2d' occurs when decoding token values in TokenRequestExecutor.createAuthenticationResultFromOauthHttpResponse for specific accounts
#922
ConfidentialClient - web site (AcquireTokenByAuthCode)
Is this a new or an existing app?
None
Issue description and reproduction steps
While using msal4j OAuth authentication, for specific users, the error 'java.lang.IllegalArgumentException: Illegal base64 character 2d' occurred.
The error location is as follows:
class TokenRequestExecutor {
...
private AuthenticationResult createAuthenticationResultFromOauthHttpResponse(HTTPResponse oauthHttpResponse) throws ParseException {
...
idTokenJson = new String(Base64.getDecoder().decode(tokens.getIDTokenString().split("\\.")[1]), StandardCharsets.UTF_8);
...
}
}
For your reference, this error does not occur in version 1.18.0 which uses Base64.getUrlEncoder().
Thank you
Relevant code snippets
Expected behavior
No response
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
No response
Solution and workarounds
No response
The text was updated successfully, but these errors were encountered:
proj2k
added
needs attention
Automatically used when an issue is created through an issue template
untriaged
Automatically used when an issue is created through an issue template
labels
Mar 12, 2025
Avery-Dunn
added
Bug
Something isn't working, needs an investigation and a fix
P2
Normal priority items, should be done after P1
and removed
needs attention
Automatically used when an issue is created through an issue template
untriaged
Automatically used when an issue is created through an issue template
labels
Mar 12, 2025
Library version used
1.19.1
Java version
1.8
Scenario
ConfidentialClient - web site (AcquireTokenByAuthCode)
Is this a new or an existing app?
None
Issue description and reproduction steps
While using msal4j OAuth authentication, for specific users, the error 'java.lang.IllegalArgumentException: Illegal base64 character 2d' occurred.
The error location is as follows:
For your reference, this error does not occur in version 1.18.0 which uses Base64.getUrlEncoder().
Thank you
Relevant code snippets
Expected behavior
No response
Identity provider
Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
Regression
No response
Solution and workarounds
No response
The text was updated successfully, but these errors were encountered: