1

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?

Lorenzo
  • 29,081
  • 49
  • 125
  • 222
  • Look in to [OpenID](http://openid.net/), that will give you what you are looking for. Stack Overflow is using it, that's how you get to log in with your google account on this site without them having anything to do with each other. – Scott Chamberlain Aug 16 '15 at 22:50
  • @ScottChamberlain: thanks for your answer but I think you've missed the real question (or I did,nt explained correctly, probably). I am happy with identity. I just need to move the authentication logic into another we app, which then will serve existing apps solely for the authentication. Iwas looking for some directions on how to implement the necessary redirects and general architecture. – Lorenzo Aug 16 '15 at 22:56
  • See this answer: http://stackoverflow.com/questions/26309792/asp-net-identity-in-microservice-architecture/26310977#26310977 – Brendan Green Aug 16 '15 at 23:54

1 Answers1

1

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.

TejSoft
  • 3,213
  • 6
  • 34
  • 58