title: SignalR authentication within a Controller?
body: <p>I'm playing with SignalR, and I can't seem to grasp authentication to build a demo app for public vs secure chat. There is one chat room, and I want to demonstrate that authenticated users will receive public messages <em>and</em> authenticated user messages. Authentication is done using the stock MVC(3) Internet app in <code>AccountController</code>. </p>
  
  <p>Getting a Hub context within the controller doesn't make sense, since it doesn't have the connection id. How can I get the connection id to add the specific connection to a group for 'secure chat?' Should it be done in the controller? Or am I missing some way to do it within the hub?</p>
  
  <pre><code>[HttpPost]
  public ActionResult LogOn(LogOnModel model, string returnUrl)
  {
      if (ModelState.IsValid)
      {
          if (Membership.ValidateUser(model.UserName, model.Password))
          {
              FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
  
              var context = GlobalHost.ConnectionManager.GetHubContext&lt;Chat&gt;();
              // add to signalr secure group
              // but no connection id here
  </code></pre>