Create a Asp.net Web Application
We will leverage the OAuth set up (in .net 4.5) to authenticate external users. The site also tracks internal users and allows simple user managment.
Add the files in STS folder from the source code:STS extensions
These file are slightly customized from the Federation Metadata example.
Edit the Constants.cs files the common name of your certificate, url and port of your STS
Add the following section to the web.config:
Meta.ashx will automatically generate the metadata document.
The RelyingParties application setting contains a list (comman delimited) of urls of trusted RPs.
Finally, add this code in the default page of the site.
If the user is authenticated and there was a federation request the code will redirect the user to the originating relying party