I am having problems working with MSAL (x) - the login popup window has completed successfully, but when I try to extract and access the token from the id token using acquireTokenSilent , this forces the application to restart (all resources for each tool for developers are network tab ) and gives the error message "Token update operation failed due to timeout: null". I searched for relevant SO / google questions but had no hope of finding similar problems. The crazy thing is, it WORKED the other day and just stopped - even returning to the same code does not solve the problem.
Using acquireTokenPopup in the silence handler displays a pop-up window, but does not allow login with the same user ("We do not recognize this domain name"), but shows the correct MS App name. It drives me crazy.
Corresponding code (in the click handler of the React component):
onMSLogin() { const { msLoginFailure } = this.props; const userAgentApplication = this.userAgentApplication; userAgentApplication.loginPopup(['user.read']) .then(function () { console.log('User login success'); const scopes = ['User.Read']; userAgentApplication.acquireTokenSilent(scopes).then((accessToken) => { console.log('Access token acquired (silent): ', accessToken); this.getGraphData(accessToken); }, (error) => { console.error('Silent token fail: ', error); userAgentApplication.acquireTokenPopup(scopes).then((accessToken) => { console.log('Access token acquired (popup): ', accessToken); }); }) }, function (error) { // handle error console.log('MS Login Failure: ', error); if (msLoginFailure) msLoginFailure(error); }); }
source share