I've found the error that I made.
I was missing a method call:
- return new AppChatIdentity(HttpContext.Current.User.Identity.Name, false,
- ToUserId(HttpContext.Current.User.Identity.Name), HttpContext.Current.Request.UserHostAddress);
Now it's working like a charm!