Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.25 KB

README.md

File metadata and controls

34 lines (25 loc) · 1.25 KB

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!