public static void LogOut(string key) { if (authorizedList.ContainsKey(key)) { authorizedList.Remove(key); } AuthorizationMiddleware.SetPrincipal(null); }
public static void LogIn(Principal principal) { string key = principal.GetKey(); if (!authorizedList.ContainsKey(key)) { authorizedList.Add(key, principal); } else { authorizedList[key] = principal; } AuthorizationMiddleware.SetPrincipal(principal); }