Пример #1
0
        private void SingIn(UserEditDto user, ClaimsIdentity identity = null, bool rememberMe = false)
        {
            if (identity==null)
            {
                identity = new ClaimsIdentity(DefaultAuthenticationTypes.ApplicationCookie);

                identity.AddClaim(new Claim(YL.Core.Runtime.YLClaimTypes.UserNameClaimType,user.UserName));
                identity.AddClaim(new Claim(YL.Core.Runtime.YLClaimTypes.UserIdClaimType, user.Id.ToString()));

            }
            AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
            AuthenticationManager.SignIn(new AuthenticationProperties {  IsPersistent=rememberMe},identity);

        }
Пример #2
0
 public LoginResultDto(UserEditDto user, ClaimsIdentity identity)
     : this(LoginResultType.Success)
 {
     User = user;
     Identity = identity;
 }