Azure AD B2C SQL Token Cache

Aidan 1 Reputation point
2019-11-27T18:59:28.347+00:00

I have set up a .Net core web application and web API and secured them using Azure AD B2C based on the following sample - https://zcusa.951200.xyz/en-us/samples/azure-samples/active-directory-b2c-dotnetcore-webapp/an-aspnet-core-web-app-with-azure-ad-b2c/

This is great for initial development but uses a static in memory cache so whenever the web app is restarted the token cache is cleared. I would like to implement SQL token caching using IDistributedCache but can only find samples that are Azure AD (not B2C) specific or out of date and using previous versions of MSAL.net (I am currently using v3).

Does anyone know of any examples that provide details for implementing a SQL token cache with Azure AD B2C?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,205 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 36,886 Reputation points Microsoft Employee
    2019-12-06T01:13:11.963+00:00

    There is no example specifically for this that I am aware of.

    I believe this exists for regular AD but not for B2C. https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2

    I would highly recommend making a feature request in User Voice, where the product team can respond directly to you. https://feedback.azure.com/forums/169401-azure-active-directory/category/160596-b2c

    I am happy to upvote any request that you make if you link it here.


Your answer

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