I have a react application authenticating with Azure AD using react-aad-msal library. The below code is working fine. But when the access token expires getAccessToken method automatically fetches the new access token and keeps the application going. But instead, I have a requirement to ask user to reauthenticate when the access token expires and if the user is Idle for the entire duration. Is there a way to do it?
const apiAuthenticationParameters = {
scopes: [config.appScope],
forceRefresh: true,
};
const getAccessToken = () => {
return AuthProvider.getAccessToken(apiAuthenticationParameters);
};