Invalidate the Token Cache when the User is Updated via Graph API
Tokens are currently being cached for 1 minute and there’s no way to invalidate this cache.
User signs up for a Azure B2C account and is redirected to the client application.
Since this is a new user the Client Application displays a custom registration form
Registration is completed in the backend and a claim is added to the user such as “RegistrationComplete”.
Client application silently refreshes the user token and gets the updated claim.
The client application sees the “RegistrationComplete” claim and doesn’t show the custom registration form.
The tokens obtained from the silent refresh do not contain the new claim. Currently we have to poll this endpoint for 1 minute until eventually it exists.
This is quite a common scenario that most providers allow. For example, OTKA and Auth0 do not cache this endpoint and the updated claims are available straight away.
The cache should be invalidated when the user object changes.