private void SubmitPasswordChanges()
    {
        ExigoApiContext.CreateWebServiceContext().UpdateCustomer(Request_UpdateCustomerPassword());

        IdentityAuthenticationService service = new IdentityAuthenticationService();
        service.RefreshIdentity();
    }
 public void Click_Logout(Object sender, EventArgs e)
 {
     try
     {
         var svc = new IdentityAuthenticationService();
         svc.SignOut();
         Response.Cookies["userCookie"].Expires = DateTime.Now.AddDays(-20);
         Response.Redirect("~/SignOut.aspx");
     }
     catch
     {
         return;
     }
 }
Example #3
0
    public void SignIn_Click(object sender, EventArgs e)
    {
        // If they want to be remembered, let's save their username to a cookie. If not, let's kill any cookies that might already exist.
        if (RememberMe) SaveUsernameCookie();
        else DeleteUsernameCookie();

            var svc = new IdentityAuthenticationService();
            if (svc.SignIn(LoginName, Password))
            {
                if (Request.QueryString["ReturnUrl"] != null)
                {
                    Response.Redirect(Request.QueryString["ReturnUrl"], false);
                }
                else
                {
                    Response.Redirect("~/Home.aspx", false);
                }
            }
            else
            {
                ErrorString = "Invalid username/password. Please try again.";
            }

    }
Example #4
0
    public void SilentLogin()
    {
            int customerID = NewCustomerID;
            string loginName = NewUsername;

            var svc = new IdentityAuthenticationService();
            if (svc.SilentLogin(customerID, loginName))
            {
                if (Request.QueryString["ReturnUrl"] != null)
                {
                    Response.Redirect(Request.QueryString["ReturnUrl"], false);
                }
                else
                {
                    Response.Redirect("~/Home.aspx", false);
                }
            }
            else
            {
                ErrorString = "Invalid username/password. Please try again.";
            }

    }
Example #5
0
 public AuthenticationController(IdentityAuthenticationService authenticationService)
 {
     _authenticationService = authenticationService;
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     var service = new IdentityAuthenticationService();
     service.SignOut();
     Response.Redirect("Login.aspx");
 }
Example #7
0
 public static Identity Deserialize(string data)
 {
     try
     {
         var ticket = FormsAuthentication.Decrypt(data);
         return new Identity(ticket);
     }
     catch(Exception ex)
     {
         var service = new IdentityAuthenticationService();
         service.SignOut();
         return null;
     }
 }
    public bool AuthenticateUserInfo()
    {
        // Go ahead and validate the request
        try
        {
            // Decrypt the 'token' query string
                //var decryptedString = Decrypt(Request.QueryString["token"], WebSettingsContext.SilentLogins.EncryptionKey);

            // Split it up by pipes
            //string[] args = decryptedString.Split('|');

            // Set some local variables so we don't have to keep accessing the array by index
            int customerID = NewCustomerID; // Convert.ToInt32(args[0]);
            string loginName = NewUsername; // args[1];
            DateTime tokenCreatedDate = DateTime.Now; // Convert.ToDateTime(args[2]);

            // If we got here, let's create the FormsAuthentication cookie and move them to the default page.
            var svc = new IdentityAuthenticationService();
            if (svc.SilentLogin(customerID, loginName))
            {
                //SaveUserCookie(loginName);
                return true;
            }
            else
            {
                Response.Write("Your user information is incorrect or invalid. Please double check your values and try again.");
                return false;
            }
        }

        // If ANYTHING goes wrong, let's just return a generic message so as not to frighten the users.
        catch
        {
            Response.Write("Your user information is incorrect or invalid. Please double check your values and try again.");
            return false;
        }
    }