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