When using @azure/msal-angula 2.0.0-alpha.3, I get this error message on ClientAuthError: state_not_found: State not found
See original GitHub issueLibrary
-
msal@1.x.x
or@azure/msal@1.x.x
-
@azure/msal-browser@2.x.x
-
@azure/msal-node@1.x.x
-
@azure/msal-react@1.x.x
-
@azure/msal-angular@0.x.x
-
@azure/msal-angular@1.x.x
-
@azure/msal-angular@2.x.x
-
@azure/msal-angularjs@1.x.x
Description
I’m developing an using @azure/msal-browser 2.9.0 on http://localhost using Angular, when trying to login via msal.loginRedirect() the browser reruns to the site, and correct page however the user is not logged in and the following error is in the console (from the handleRedirectObservable method) ClientAuthError: state_not_found: State not found: Cached State
Source
export function MSALInstanceFactory(): IPublicClientApplication {
return new PublicClientApplication({
auth: {
clientId: 'clientId',
authority: 'authority',
redirectUri: 'http://localhost:4200',
postLogoutRedirectUri: 'http://localhost:4200',
knownAuthorities: ['knownAuthorities.b2clogin.com',
'knownAuthorities.onmicrosoft.com'],
navigateToLoginRequestUrl:true
},
cache: {
cacheLocation: BrowserCacheLocation.LocalStorage,
storeAuthStateInCookie: isIE, // set to true for IE 11
},
system: {
loggerOptions: {
loggerCallback,
logLevel: LogLevel.Info,
piiLoggingEnabled: false
}
}
});
}
this.msal.handleRedirectObservable().subscribe({
next: (result: AuthenticationResult) => {
console.error('result called', result);
if (result) {
// this.authService.instance.setActiveAccount(result.account);
console.log(result);
}
},
error: (error) => console.log(error)
});
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
When using @azure/Msal-browser, I get this error message on ...
This error can be caused if the handleRedirectPromise is called twice. msal-react should call this function for you, so there is no need...
Read more >Getting error while login with Angular application in Azure AD
This error is due to when configuration has not been correctly set in your application. It seems in the app.module.ts application where you...
Read more >ui-router: Deprecated events and hooks | Stepan Suvorov Blog
0-alpha ) you probably already noticed that there are no events that we all got used to: $stateChangeCancel, $stateChangeError, $stateChangeStart ...
Read more >State.stateservice - UI-Router
Returns the state declaration object for any specific state, or for all registered states. Parameters. stateOrName StateOrName. : (absolute or relative) If ...
Read more >Common Errors and Warnings | Cribl Docs
This page lists common error and warning messages that you might find in LogStream's internal logs and/or UI. It includes recommendations for resolving...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jitendraP-ashutec The latest versions of msal-browser and msal-angular were released last night. This new version has guidance on using redirects, as well as a new
inProgress$
observable that you can subscribe to, to ensure no interactions are in progress when you check for accounts. Please update usingnpm install @azure/msal-browser@2.11.0 @azure/msal-angular@alpha
and give the new version a try. You can find documentation oninProgress$
here.This issue has been closed due to inactivity. If this has not been resolved please open a new issue. Thanks!