acquireTokenSilent raise a page refresh in Azure AD

Mahesh C M 151 Reputation points
2021-02-02T05:45:29.997+00:00

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

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,844 questions
{count} votes