Three questions about OWIN (Katana) authentication RRS feed

  • Question

  • Hello!

    I am developing a self-hosted OWIN application with SignalR and with .NET Client and I want to make custom login+password authenticationin it. I have subclassed AuthenticationHandler and have only three questions.

    1. When HubConnection is created, can credentials be passed via Credentials property (line 2 instead of 3 and 4)? If yes, how can these credentials be processes on server side?

    this.connection = new HubConnection(address);
    //this.connection.Credentials = new System.Net.NetworkCredential(userName, password);
    this.connection.Headers.Add("login", userName);
    this.connection.Headers.Add("password", password);

    When overriding AuthenticateCoreAsync() method on server side custom authentication, I can return an object of type AuthenticationTicket:

    var identity = new ClaimsIdentity();
    identity.AddClaim(new Claim(ClaimTypes.Name, login));
    return Task.FromResult(new AuthenticationTicket(identity, new AuthenticationProperties { IsPersistent = true }));

    2. The resulting identity has IsAuthenticated property equal to false. How it can be set to true? Did I miss something?

    3. How does IsPersistent work? Why authentication is performed on every request?

    Maybe there is a good explanation of this on the web by I did not found it.

    Thank you for any help.

    Vladimir Khil

    • Edited by Ur-Quan Thursday, September 17, 2015 6:58 PM
    Thursday, September 17, 2015 6:58 PM


  • Hi Vladimir,

    Per my understanding, this question is more related to ASP.NET forum. I suggest you post these three questions on that forum for effective response. http://forums.asp.net/


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Ur-Quan Sunday, September 20, 2015 8:03 PM
    Friday, September 18, 2015 6:28 AM