Exemple #1
0
        public AuthResult AddLogin(int userId, UserLoginInfo loginInfo)
        {
            loginInfo.ThrowIfNull("loginInfo");

            var identityUserLoginInfo = IdentityModelFactory.Create(loginInfo);
            var identityResult        = _userManager.AddLogin(userId, identityUserLoginInfo);
            var appIdentityResult     = IdentityModelFactory.Create(identityResult);

            return(appIdentityResult);
        }
Exemple #2
0
        public User FindByUserLoginInfo(UserLoginInfo loginInfo)
        {
            loginInfo.ThrowIfNull("loginInfo");

            var userLoginInfo   = IdentityModelFactory.Create(loginInfo);
            var appIdentityUser = _userManager.Find(userLoginInfo);
            var user            = IdentityModelFactory.Create(appIdentityUser);

            return(user);
        }
Exemple #3
0
        public async Task <AuthResult> AddLoginAsync(int userId, UserLoginInfo loginInfo)
        {
            loginInfo.ThrowIfNull("loginInfo");

            var identityUserLoginInfo = IdentityModelFactory.Create(loginInfo);
            var identityResult        = await _userManager.AddLoginAsync(userId, identityUserLoginInfo);

            var appIdentityResult = IdentityModelFactory.Create(identityResult);

            return(appIdentityResult);
        }
Exemple #4
0
        public async Task <User> FindByUserLoginInfoAsync(UserLoginInfo loginInfo)
        {
            loginInfo.ThrowIfNull("loginInfo");

            var userLoginInfo   = IdentityModelFactory.Create(loginInfo);
            var appIdentityUser = await _userManager.FindAsync(userLoginInfo);

            var user = IdentityModelFactory.Create(appIdentityUser);

            return(user);
        }
        public static Microsoft.AspNet.Identity.UserLoginInfo Create(UserLoginInfo coreUserLoginInfo)
        {
            if (coreUserLoginInfo == null)
            {
                return(null);
            }

            var identityUserLoginInfo = new Microsoft.AspNet.Identity.UserLoginInfo(
                coreUserLoginInfo.LoginProvider, coreUserLoginInfo.ProviderKey);

            return(identityUserLoginInfo);
        }
        public static UserLoginInfo Create(Microsoft.AspNet.Identity.UserLoginInfo identityUserLoginInfo)
        {
            if (identityUserLoginInfo == null)
            {
                return(null);
            }

            var coreUserLoginInfo = new UserLoginInfo(
                identityUserLoginInfo.LoginProvider, identityUserLoginInfo.ProviderKey);

            return(coreUserLoginInfo);
        }