Hi @Adrien Ruffie ,
Thanks for reaching out and apologies for delay in response.
Your understanding is correct here. In-memory caches are good for applications that don't require tokens to persist between app restarts which is mainly for local app development.
As mentioned in the link provided by you, AcquireTokenByAuthorizationCode() require user interaction to get the access token. So, to persist the user details is not recommended using in memory cache.
For token persistence, MSAL provides and recommended to use distributed token cache (Redis, SQL Server, Azure Cosmos DB, distributed memory) to request tokens for users in a production application.
A distributed memory cache will not clear when the app stops. In this case, the cached items are stored by the app instance on the server where app is running.
Hope this will help.
Thanks,
Shweta
Please remember to "Accept Answer" if answer helped you.