Authentication

Now that we have the configuration in place for securing our site properly, we want to be able to actually log into the site:

  1. Let's add the security handler that we just configured. Right-click on the web project and navigate to Add | New item. Select Web and then select Generic Handler. Give it the name SecurityHandler.ashx:
    Authentication
  2. We will, for simplicity, be hardcoding our users, passwords, and roles. At the top of the SecurityHandler.ashx file, add the following:
    Dictionary<string, string> _usersAndPassword = new Dictionary<string, string> { { "SomeCreator", "1234" }, { "SomeChatter", "1234" } }; Dictionary<string, string[]> _usersAndRoles ...

Get SignalR - Real-time Application Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.