Authorization Header in SignalR 2.0

I solved this by passing the token as a parameter of my Hub method instead of header. but i imagine it is possible to do it using headers too (just extracting the token from Context.Headers or something).

Either way, after getting the token in your hub method, just use this code.

    public Task SendMessage(string message, string token)
    {
        var ticket = Startup.OAuthOptions.AccessTokenFormat.Unprotect(token);
        bool isAuth = ticket.Identity.IsAuthenticated;
       //You can retrieve other details like username and userid from ticket
       ...rest of your code..
    }