Does the ASP.NET Web API Bearer Token work in a load balancing scenario? Will it maintain the generated token across all the installations and servers in a load balancing scenario?
Thanks
Does the ASP.NET Web API Bearer Token work in a load balancing scenario? Will it maintain the generated token across all the installations and servers in a load balancing scenario?
Thanks
It does. The generated token is signed with the machine key of the configuration (this depends on how you host your API). If you run multiple Windows Servers in a cluster this config should be the same for all servers in the cluster. With that you shouldn't have a problem. A good example for that scenario is running an application using ASP.NET Identity on Microsoft Azure. In that case you will not face this problem that the bearer token is invalid because server A signed it and you are routed to server B.
For more Information on this have a look at the answer from Brock Allen in this question.