Пример #1
0
        public void CreateNewUserTest()
        {
            string openid         = "myopenid";
            string friendlyopenid = "friendlyopenid";
            string email          = "*****@*****.**";

            UsersModels user = new UsersModels();

            user = user.CreateNewUser(openid, friendlyopenid, email);

            Assert.AreEqual(openid, user.OpenId[0].OpenId);
            Assert.AreEqual(friendlyopenid, user.OpenId[0].FriendlyOpenId);
        }
Пример #2
0
        public ActionResult OpenIdConfirm(RegisterOpenId openId)
        {
            UsersModels user = new UsersModels();

            user.CreateNewUser(openId.ClaimedOpenId, openId.FriendlyOpenId, openId.Email);

            FormsAuthenticationService formAuth = new FormsAuthenticationService();

            formAuth.SignIn(openId.ClaimedOpenId, false);

            if (!string.IsNullOrEmpty(openId.ReturnUrl))
            {
                return(Redirect(openId.ReturnUrl));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
Пример #3
0
        public ActionResult OpenIdConfirm(RegisterOpenId openId)
        {
            UsersModels user = new UsersModels();
            user.CreateNewUser(openId.ClaimedOpenId, openId.FriendlyOpenId, openId.Email);
            
            FormsAuthenticationService formAuth = new FormsAuthenticationService();
            formAuth.SignIn(openId.ClaimedOpenId, false);

            if (!string.IsNullOrEmpty(openId.ReturnUrl))
                return Redirect(openId.ReturnUrl);
            else
                return RedirectToAction("Index", "Home");
        }