Skip to content

B2C does not always issue access token but TokenResponse assumes there is an access token resulting in a JSON parse error #140

@alex-mason-by

Description

@alex-mason-by

Using MSAL4J library with B2C can result in a JSON parse error due to an assumption in TokenResponse that doesn't always hold with B2C and that assumption is that an access token is always returned. The refresh token has the same assumption although perhaps that is fine? In the case where MSAL4J is used for a server-side application login that needs no custom scope then no access token is returned and this code should not blow up on that scenario.

https://github.com/AzureAD/microsoft-authentication-library-for-java/blob/dev/src/main/java/com/microsoft/aad/msal4j/TokenResponse.java#L48
final AccessToken accessToken = AccessToken.parse(jsonObject);
final RefreshToken refreshToken = RefreshToken.parse(jsonObject);

Metadata

Metadata

Assignees

Labels

Service IssueIssue is in some other part of the Identity platform, outside of MSAL Java itselfWork-around ProvidedIssue has a known work-around, which could one day be integrated into MSAL Java

Type

No type

Projects

Status

Done (in PR or next release)

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions