Share via

Angular MSAL Token Refresh

Andi Leka 20 Reputation points
2024-09-27T15:35:28.28+00:00

I’m using the Microsoft Graph API to change the AppRoleAssignments for users in order to manage their roles from the backend. After updating the roles, I signal Angular MSAL to refresh the token using 'acquireTokenSilent' with 'forceRefresh'. However, the new token still contains the old role(s) in the claims.

When I change the roles again and trigger 'acquireTokenSilent', this time the new claims do not include the previous role(s). But still they will include the just deleted role(s) (same thing for adding a new role). It feels like I'm always one step behind. The same issue occurs with 'loginRedirect'.

Microsoft Security | Microsoft Entra | Microsoft Entra ID

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.