Ejemplo n.º 1
0
        public static async Task LoginAsync(string username, string password)
        {
            try
            {
                var identity = await PTIdentity.GetPTIdentityAsync(username, password);

                SetPrincipal(identity);
            }
            catch (Exception ex)
            {
                Logout();
            }
        }
Ejemplo n.º 2
0
        public static async Task <bool> LoadAsync(string username)
        {
            var current = Csla.ApplicationContext.User;

            if (current != null && current.Identity != null && current.Identity.Name == username)
            {
                return(true);
            }

            var identity = await PTIdentity.GetPTIdentityAsync(username);

            return(SetPrincipal(identity));
        }
Ejemplo n.º 3
0
        public static async System.Threading.Tasks.Task LoginAsync(string username, string password)
        {
            try
            {
                var identity = await PTIdentity.GetPTIdentityAsync(username, password);

                SetPrincipal(identity);
            }
            catch
            {
                Logout();
            }
        }