Exemplo n.º 1
0
        public static void Logout()
        {
            Csla.Security.CslaIdentity identity = SLIdentity.UnauthenticatedIdentity();
            SLPrincipal principal = new SLPrincipal(identity);

            Csla.ApplicationContext.User = principal;
        }
Exemplo n.º 2
0
 public static void Login(string username, string password, string roles, EventHandler <EventArgs> completed)
 {
     SLIdentity.GetIdentity(username, password, roles, (o, e) =>
     {
         bool result = SetPrincipal(e.Object);
         completed(null, new LoginEventArgs(result));
     });
 }
Exemplo n.º 3
0
 public static void Login(string username, string password, EventHandler <EventArgs> completed)
 {
     SLIdentity.GetIdentity(username, password, (o, e) =>
     {
         SetPrincipal(e.Object);
         completed(null, new EventArgs());
     });
 }
Exemplo n.º 4
0
 private static bool SetPrincipal(Csla.Security.CslaIdentity identity)
 {
     if (identity.IsAuthenticated)
     {
         SLPrincipal principal = new SLPrincipal(identity);
         Csla.ApplicationContext.User = principal;
     }
     else
     {
         identity = SLIdentity.UnauthenticatedIdentity();
         SLPrincipal principal = new SLPrincipal(identity);
         Csla.ApplicationContext.User = principal;
     }
     return(identity.IsAuthenticated);
 }