Ejemplo n.º 1
0
        public static void RegistrarLogin(string cpf, Laboris.Cosan.Service.Omnion.Login usuarioOmnion, string senha, HttpResponse Response)
        {
            HttpCookie authCookie = FormsAuthentication.GetAuthCookie(cpf, false);

            FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);
            FormsAuthenticationTicket newTicket = new FormsAuthenticationTicket(ticket.Version, ticket.Name, ticket.IssueDate, ticket.Expiration, ticket.IsPersistent, usuarioOmnion.Nome);

            authCookie.Value = FormsAuthentication.Encrypt(newTicket);
            authCookie.Path = FormsAuthentication.FormsCookiePath;

            Response.Cookies.Add(authCookie);

            IPrincipal p = new GenericPrincipal(new FormsIdentity(newTicket), null);

            UsuarioLogado usuarioLogado = new UsuarioLogado(usuarioOmnion, senha);
            HttpContext.Current.Session["UsuarioOmnion"] = usuarioLogado;
            HttpContext.Current.User = p;
            Thread.CurrentPrincipal = p;
        }
Ejemplo n.º 2
0
        private string RedirectParceiro(UsuarioLogado usuario)
        {
            if (Request.QueryString["ProdID"] != null)
            {
                pagina = @"http://www.submarino.com.br/CommonIncentiveProgram/default.aspx?Login="******"&token=" + usuario.SenhaMD5 + "&partnerID=295810&RequestUrl=ProductDetail.aspx?ProdID=" + Request.QueryString["ProdID"].ToString();

                if (Request.QueryString["Parceiro"] != null)
                {
                    if (Request.QueryString["Parceiro"].ToString() == "2")
                    {
                        pagina = "redirectCupom.aspx?ProdID=" + Request.QueryString["ProdID"].ToString() + "&Login="******"&token=" + usuario.SenhaMD5;
                    }
                    else if (Request.QueryString["Parceiro"].ToString() == "4")
                    {
                        pagina = @"http://loja.autoguiagps.com.br/esso.aspx?Login="******"&token=" + usuario.SenhaMD5 + "&IdProductSale=" + Request.QueryString["IdProductSale"];
                    }
                    else if (Request.QueryString["Parceiro"].ToString() == "5")
                    {
                        pagina = @"https://fielo-cosan.secure.force.com/Login?Login="******"&token=" + usuario.SenhaMD5 + "&prodId=" + Request.QueryString["prodId"];
                    }

                    else if (Request.QueryString["Parceiro"].ToString() == "6")
                    {
                        pagina = @"http://www.maniavirtual.com.br/pontosprocessa.aspx?Login="******"&token=" + usuario.SenhaMD5 + "&prodId=" + Request.QueryString["prodId"];
                    }

                    else if (Request.QueryString["Parceiro"].ToString() == "7")
                    {
                        pagina = @"http://www.maniavirtual.com.br/pontosprocessa.aspx?Login="******"&token=" + usuario.SenhaMD5 + "&prodId=" + Request.QueryString["prodId"];
                    }

                }
            }
            else
            {
                if (Request.QueryString["Parceiro"] != null)
                {
                    if (Request.QueryString["Parceiro"].ToString() == "3")
                    {
                        pagina = @"http://www.imperdivel.com.br/programapontos/callback/?origem=cosan&Login="******"&token=" + usuario.SenhaMD5;
                    }
                    else if (Request.QueryString["Parceiro"].ToString() == "4")
                    {
                        pagina = @"http://loja.autoguiagps.com.br/esso.aspx?Login="******"&token=" + usuario.SenhaMD5 + "&IdProductSale=" + Request.QueryString["IdProductSale"];
                    }
                    else if (Request.QueryString["Parceiro"].ToString() == "5")
                    {
                        pagina = @"https://fielo-cosan.secure.force.com/Login?Login="******"&token=" + usuario.SenhaMD5;
                    }

                    else if (Request.QueryString["Parceiro"].ToString() == "6")
                    {
                        pagina = @"http://www.maniavirtual.com.br/pontosprocessa.aspx?Login="******"&token=" + usuario.SenhaMD5;
                    }
                }
            }

            return pagina;
        }