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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.