Demonstrate how to validate an ACS token in an ASP.NET Web API service
Перейти к файлу
Wade Wegner a09552d749 Added the "OAuth" bearer back to the Auth header 2012-06-13 16:14:48 -04:00
PhoneApp Added the "OAuth" bearer back to the Auth header 2012-06-13 16:14:48 -04:00
WebAPI Added the "OAuth" bearer back to the Auth header 2012-06-13 16:14:48 -04:00
packages
.gitignore
README.md Updated README.md 2012-06-13 15:51:44 -04:00
ValidateACSTokenWebAPI.sln

README.md

ValidateACSTokenWebAPI

Demonstrate how to validate an ACS token in an ASP.NET Web API service.

Special thanks to @woloski for quickly (and ably) putting together the SimpleWebToken library for parsing and validating simple web tokens and @vibronet for pointing me towards ASP.NET Web API DelegatingHandler.

Usage

Two steps for updating:

  1. Update TokenValidationHandler.cs and replace "yourtokensigningkey" with your key from the Access Control Service:
var validator = new SimpleWebTokenValidator 
{
	SharedKeyBase64 = "yourtokensigningkey"	
};
  1. Update AccessControlResources.xaml and replace "youracsnamespace" and "yourrealmname" with the values you specified in the Access Control Service:
    <system:String x:Key="acsNamespace">youracsnamespace</system:String>
    <system:String x:Key="realm">uri:yourrealmname</system:String>

Enjoy!