a09552d749 | ||
---|---|---|
PhoneApp | ||
WebAPI | ||
packages | ||
.gitignore | ||
README.md | ||
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:
- Update TokenValidationHandler.cs and replace "yourtokensigningkey" with your key from the Access Control Service:
var validator = new SimpleWebTokenValidator
{
SharedKeyBase64 = "yourtokensigningkey"
};
- 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!