Search code examples
asp.netauthenticationasp.net-web-apisignalrasp.net-identity

How to share authentication between two asp.net application


I already an asp.net application A use Web API and identity.

Now I would like to create another asp.net application B use SingalR, host on different server

So how the application B use the authentication in A?

Currently, my idea is to do something like OAuth, so if this is correct, how to do it in Asp.net identity? Or I have to write all things myself.

Thank you


Solution

  • There are lots of way to solve this problem, but JWT may be the way to go here. You can use Application A to provide authentication (as you are currently doing). Application A will return a json web token which you can use to authorize users on Application B assuming you use the same backing secret for them both.