Reputation: 29427
I currently have two web applications, one of which is a web api, which both have it's own implementation of ASP.NET Identity for authenticating users (first one is cookie and second one is bearer tokens). I need, in the near future, to add a third web site to the family and was thinking to move the authentication logic in a standalone web application which could serve all the orhers.
For example: instead of authenticating to www.mysite.com
and/or api.mysite.com
, I would like that both the applications could authenticate against a new website, like e.g. login.mysite.com
, as microsoft does.
How can I achieve something like this? Does somebody has any direction to start with?
Upvotes: 1
Views: 213
Reputation: 3315
What you need is an Identity Server which will authenticate the requests and give you back an access token. You can then use the access token to make subsequent requests to APIs and websites etc. As long as the access token is valid you will be able to make requests. There is great .net based open source solution available for Identity Server. Have a look at Thinktecture. You can download the source and demo projects to try yourself.
Upvotes: 1