Custom oAuth server implementation and its advantages

HaBo picture HaBo · Apr 15, 2015 · Viewed 10.5k times · Source

We have multiple web projects(sites), each has its own Authorization logic. Today I have been asked by my CIO to implement oAuth and use that for validating user across all sites.

Earlier I have used oAuth for Google, Facebook, Twitter and Microsoft. I have multiple questions here

  1. What are the advantages of implementing oAuth provider
  2. What is the best approach in a generic oAuth principles
  3. Can I use this oAuth server for Single Sign On

When I have user oAuth from Google or other, the idea was to eliminate user effort to register on my site rather use the same credentials that he/she hae for Google. Is that the only advantage I would get if I create my custom oAuth?

Implementing oAuth:

  • Create a Application Entity with ApplicationName, ClientID, ClientSecrete
  • Create User Entity with UserId, UserName, Password, ApplicationID
  • Share the unique ClientID and Secrete with each site and when the user tries to log in from that site, pass the clientID, clientSecrete, UserName, Password and validate and return true or false
  • Follow the similar flow for user to register to the system.

On a high level will my above flow satisfies oAuth concept? is there a in-depth implementation details of oAuth that I can refer to get better understanding?

Answer

Laurent Lequenne picture Laurent Lequenne · Apr 15, 2015

http://oauth.net/articles/authentication/

That's a good read, to tell you what should you use for OAuth and not :=)

https://msdn.microsoft.com/en-us/library/hh291066(v=vs.110).aspx Windows Identity Fundation ... Can help you with a unique authorization, across different applications, and layers..

And here finally some how to do guidelines :

http://www.c-sharpcorner.com/UploadFile/scottlysle/windows-identity-foundation-and-single-sign-on-sso/