PeterLiguda PeterLiguda - 7 months ago 44
ASP.NET (C#) Question

Load balancing with ASP.NET and ADFS

We're using ASP.NET MVC 5 with external authentication based on ADFS. Wea are using


Now we want to use a second instance. The load balancer uses an own cookie to identify a user and to enable sticky sessions.

The problem now is, that the user is not authenticated when a second instance is attached to the load balancer.

I think it is a configuration issue of ADFS. Is there any option which could occurs this error here? Or any other help?

Ben Ben

Solution: Microsoft.IdentityModel uses Windows Data Protection API. This stored the token key inside the Windows DPAPI. Problem: this cannot be synced with other machines because the encryption key is different on every machine.

You have to switch your provider to Security.IdentiyModel.