Skip to content

Instantly share code, notes, and snippets.

View stonetip's full-sized avatar

Jon Nehring stonetip

View GitHub Profile
@stonetip
stonetip / TokenValidationHandler.cs
Last active August 29, 2015 13:55
JWT token validation class
internal class TokenValidationHandler : DelegatingHandler
{
// This function retrieves ACS token (in format of OAuth 2.0 Bearer Token type) from
// the Authorization header in the incoming HTTP request from the client.
private static bool TryRetrieveToken(HttpRequestMessage request, out string token)
{
try
{
token = null;
IEnumerable<string> authHeaders;