Are there any example projects / open-source solutions I can learn from that will help me to build a custom OAuth / OpenID provider on OWIN / ASP.NET for my organisation? The problem space is pretty new to me so I'd like to pickup as many best practices as possible and hopefully avoid any security holes.
Basically I need to create a single login service for users that will be used from multiple web applications and APIs by external users. This solution will in turn allow people to delegate login using other 3rd parties such as Google, Twitter, etc. but will add value by linking users to their CRM records etc. and adding further claims for our web applications to consume.
What we're trying to achieve internally is something along the lines of what Auth0 does.
IdentityServer3 is a framework for building SSO solutions.