Search code examples
asp.net-identityload-balancing

Using ASP.NET Identity with a load balancer


Does ASP.NET Identity stores two-factor authentication and reset password tokens in memory?

Then what's the solution if we have many copies of a project behind a load balancer? It's possible to store those tokens in a database?

Is there any other issue if we want to use a load balancer?


Solution

  • Tokens are not stored in server memory, but on the client (link, cookie etc.). So a load balancer is supported as long as you keep the machinekey in the web.config the same on all web servers.

    Because of the above it's not necessary to store them in a database. There is a possibility to do so. See also this similar question (I see it has a similar answer :-)) How are bearer tokens stored server-side in Web API 2?