Skip to content

Incorrect parsing of ClientInfo when trying to authorize on some old accounts #281

@RomanNosachov

Description

@RomanNosachov

While testing our application using the MSAL4j (authorization by code), we identified the following problem: some clients could not authorize, because when receiving a response from the server, they received a response parsing error:

java.lang.IllegalArgumentException: Illegal base64 character 2d

After debugging, I managed to find a problem: in the ClientInfo class, when parsing a response from JSON, Base64 encoded characters are expected, but in practice, responses arrive that may contain Base64url encoded characters, such as '_' and '-'.
More about encoding differences: RFC 4648
I corrected the code in the fork by replacing Base64.getDecoder with Base64.getUrlDecoder and our clients were able to log in
and user Microsoft Graph API.
We hope that you will correct this error so that we can use your version of the library again.

Link to pull request: #282

Best regards, Roman Nosachev, middle Kotlin developer at Getapy

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working, needs an investigation and a fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions