question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClientAuthError: access_token_entity_null: Access token entity is null, please check logs and cache to ensure a valid access

See original GitHub issue

Core Library

@azure/msal-browser

Core Library Version

2.14.1

Wrapper Library

Not Applicable

Wrapper Library Version

0

Description

on handleRedirectPromise() after login

ClientAuthError: access_token_entity_null: Access token entity is null, please check logs and cache to ensure a valid access token is present.

Error Message

No response

Msal Logs

No response

MSAL Configuration

this.app = new Msal.PublicClientApplication({
                auth: {
                    clientId: `${BaseConfig.AppClientID}`,
                    authority: `${BaseConfig.AppLoginAuthority}`,
                    knownAuthorities: [`${BaseConfig.AppLoginAuthority}`],
                    validateAuthority: false,
                    navigateToLoginRequestUrl: true,
                    redirectUri: `${BaseConfig.AppUrl}login`,
                    postLogoutRedirectUri: `${BaseConfig.AppUrl}login`,
                },
                cache: {
                    cacheLocation: "sessionStorage",
                    storeAuthStateInCookie: true,
                    secureCookies: true
                }
            });

Relevant Code Snippets

this.app.handleRedirectPromise().then(response => {
                console.log("response", response);
                if (response) {
                    this.handleResponse(response);
                }
            }).catch(error => {
                console.log(error);
            });

Reproduction Steps

  1. immediately after login

Expected Behavior

should return object with correct data.

Identity Provider

Azure B2C Basic Policy

Browsers Affected (Select all that apply)

Edge

Regression

2.13.1

Source

External (Customer)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
kberawalacommented, Apr 28, 2021

Below is the workaround, worked for me.

signin() {
  var request = {
      redirectStartPage: `${BaseConfig.AppUrl}login`,
      scopes: ["openid", "profile", `${YourAppClientID}`] // this line wasn't there before, this for AD B2C
  }
  this.app.loginRedirect(request);
}
2reactions
brrianncommented, Apr 27, 2021

I saw this issue as well. Solution was to update @azure/msal-browser 2.11.2 to 2.14.0 as @DmytroKuznyetsov mentioned. Ideally we would update to latest, but maybe best to hold off is this bug is present in 2.14.1 as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with Azure AD B2C MSAL authentication
... "ClientAuthError: access_token_entity_null: Access token entity is null, please check logs and cache to ensure a valid access token is ...
Read more >
Acquire and cache tokens with Microsoft Authentication ...
Access tokens enable clients to securely call web APIs protected by Azure. There are several ways to acquire a token by using the...
Read more >
Access your source provider in CodeBuild
Provides information about how to use a personal access token in AWS CodeBuild to connect to GitHub or Bitbucket.
Read more >
Auth0 JavaScript SDK Quickstarts: Login
We recommend that you log in to follow this quickstart with examples configured for ... access_token : to learn more, see the Access...
Read more >
Using JWT for Authentication in a Golang Application
Access Token : An access token is used for requests that require authentication. ... "Please provide valid login details") return } token, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found