Please follow the issue template below. Failure to do so will result in a delay in answering your question.
[email protected] or @azure/[email protected]@azure/[email protected]@azure/[email protected]@azure/[email protected]@azure/[email protected]Important: Please fill in your exact version number above, e.g. [email protected].
React
Got a syntax error while trying to login
Uncaught (in promise) SyntaxError: Unexpected token e in JSON at position 0
at JSON.parse (
at t.getIdTokenCredential (index.d9b6c51d.js:2)
at t.e.getSpecificCredential (index.d9b6c51d.js:2)
at index.d9b6c51d.js:2
at Array.forEach (
at t.e.getCredentialsFilteredByInternal (index.d9b6c51d.js:2)
at t.e.getCredentialsFilteredBy (index.d9b6c51d.js:2)
at t.e.readRefreshTokenFromCache (index.d9b6c51d.js:2)
at t.
at index.d9b6c51d.js:2
Uncaught (in promise) SyntaxError: Unexpected token e in JSON at position 0
at JSON.parse (
at t.getIdTokenCredential (index.d9b6c51d.js:2)
at t.e.getSpecificCredential (index.d9b6c51d.js:2)
at index.d9b6c51d.js:2
at Array.forEach (
at t.e.getCredentialsFilteredByInternal (index.d9b6c51d.js:2)
at t.e.getCredentialsFilteredBy (index.d9b6c51d.js:2)
at t.e.readRefreshTokenFromCache (index.d9b6c51d.js:2)
at t.
at index.d9b6c51d.js:2
const publicClientApp = new PublicClientApplication({
auth: {
clientId: this.clientId,
authority: this.authority,
redirectUri: this.loginRedirectUri,
postLogoutRedirectUri: this.postLogoutRedirectUri
},
cache: {
cacheLocation: "localStorage",
storeAuthStateInCookie: isIEOrOldEdge // https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1188#issuecomment-634281307
},
system: {
tokenRenewalOffsetSeconds: 60,
iframeHashTimeout: 30000, // iframe is used to refresh the refresh_token as it has a 24h lifetime
loggerOptions: {
loggerCallback: MsalAuthContext.msalLoggerCallback,
piiLoggingEnabled: false,
logLevel: LogLevel.Verbose
}
}
});
// Provide relevant code snippets here.
// For Azure B2C issues, please include your policies.
No error
Let me know if you need any more info from me regarding state of localStorage etc
We are also seeing this in 2.4.1
@hectormmg Can you port the fix you did for v1 here? Looks like the same issue.
Getting the same error in 2.5.1
We also encountered this problem.
Is there a work around in the meantime?
Please try using 2.5.2 if you are having issues. If this does not fix your problem comment here.
It is working for me now with version 2.5.2. Thank you @pkanher617
Closing as #2527 fixes this PR.
Most helpful comment
Please try using 2.5.2 if you are having issues. If this does not fix your problem comment here.