I just had to change this line:
Return New AppChatIdentity(HttpContext.Current.User.Identity.Name, False, HttpContext.Current.User.Identity.Name, HttpContext.Current.Request.UserHostAddress)
To:
Return New AppChatIdentity(HttpContext.Current.User.Identity.Name, False, ToUserId(HttpContext.Current.User.Identity.Name), HttpContext.Current.Request.UserHostAddress)