acquireTokenSilent raise a page refresh in Azure AD
Mahesh C M
156
Reputation points
I have a web application build with SPA(React js) and integrate with Azure AD. I am facing an issue with token refresh in backend. when the application calls acquireTokenSilent method , the user gets signout from the application and show a popup like "can't able to sign the user". Is there any way to resolve this signout issue in SPA. Could anyone help me on this
Below given is the configuration which i used in SPA.
import { MsalAuthProvider, LoginType } from 'react-aad-msal';
// Msal Configurations
const config = {
auth: {
authority: 'https://login.microsoftonline.com/XXXXXXXXXXXXXXXXX/',
clientId: 'XXXXXXXXXXXXXXXXX',
//redirectUri: 'https://localhost:44311/signOut',
postLogoutRedirectUri: 'https://localhost:44311/signOut',
validateAuthority: true,
navigateToLoginRequestUrl: true
},
cache: {
cacheLocation: "sessionStorage",
storeAuthStateInCookie: false
}
};
// Authentication Parameters
const authenticationParameters = {
scopes: ['api://XXXXXXXXXXXXXXXXX/user_impersonation', 'api://XXXXXXXXXXXXXXXXX/User.Read', 'User.Read']
}
// Options
const options = {
loginType: LoginType.Redirect,
tokenRefreshUri: window.location.origin
}
export const authtest = new MsalAuthProvider(config, authenticationParameters, options)
Regards
Mahesh
Sign in to answer