DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. #6492

@Michael-006

Description

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

3.0.4

Public or Confidential Client?

Public

Description

When having special characters in the displayName like my tester special charactersčćęèéêëėįìíîï msal throws an error "Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded."

After this error I'm getting:

ClientAuthError: token_parsing_error: Token cannot be parsed. Please review stack trace to determine root cause. Failed with error: InvalidCharacterError: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.

Error Message

DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.

Msal Logs

No response

MSAL Configuration

not relevant

Relevant Code Snippets

try {
    const oe = S(Q);
    return JSON.parse(oe)
} catch (oe) {
    throw d.e.createTokenParsingError(oe)

Reproduction Steps

Set display name to my tester special charactersčćęèéêëėįìíîï

Expected Behavior

no error, should decode correctly

Identity Provider

Azure B2C Custom Policy

Browsers Affected (Select all that apply)

Chrome

Regression

No response

Source

External (Customer)