0

This is my class MyHub

public class MyHub : Hub
{
    public bool AuthenRequest(string customerId, string sessionAccount, byte[] cusId)
    {
        bool Authen = ATDChatServer.Instance.OnAuthenRequest(customerId, sessionAccount, cusId);
        if (Authen)
        {
            var user = Context.User;
            return user.Identity.IsAuthenticated;
        }
        return false;
    }
}

It throws an exception user is null.

I've searched some solution, one of those is: here

ConfigureAuth(app);
app.MapSignalR();

But when I insert this code to my StartUp class:

ConfigureAuth(app);

It shows error : The name 'ConfigureAuth(app)' doesn't exist in current text?

How to insert it?

Community
  • 1
  • 1
anhtv13
  • 1,636
  • 4
  • 30
  • 51

1 Answers1

0

ConfigureAuth is not part of some framework or library that you need to include. It is a implementation. If you new up a MVC project with authentication, you will see a "default" implementation of setting up the authentication pipeline. You can also find out more from here, http://blogs.msdn.com/b/webdev/archive/2013/07/03/understanding-owin-forms-authentication-in-mvc-5.aspx

Louis Lewis
  • 1,298
  • 10
  • 25