PeterLiguda PeterLiguda - 11 days ago 4
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

Microsoft.IdentityModel.Web.WSFederationAuthenticationModule
.

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
Answer

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.

Comments