Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Demonstrate how to validate an ACS token in an ASP.NET Web API service
C# ASP
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
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:

1) Update TokenValidationHandler.cs and replace "yourtokensigningkey" with your key from the Access Control Service:

var validator = new SimpleWebTokenValidator 
{
    SharedKeyBase64 = "yourtokensigningkey" 
};

2) 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!

Something went wrong with that request. Please try again.