Example #1
0
        public static async Task <ClaimsIdentity> GenerateUserIdentityAsync(this FrontendUser user, UserManager <FrontendUser> manager)
        {
            // TODO[ds]: it looks like it never called
            // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
            var userIdentity = await manager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie);

            // Add custom user claims here
            return(userIdentity);
        }
Example #2
0
        private bool Login(FrontendUser credentials)
        {
            if (credentials == null)
            {
                return(false);
            }
            var loginArgs = new LoginEventArgs {
                Username = credentials.username, Password = credentials.password
            };

            if (OnLogin(this, loginArgs))
            {
                return(true);
            }
            return(false);
        }