Iron Speed Technical Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
dnelson241

Registered:
Posts: 30
Reply with quote  #1 

Akesh G. has a Video Demo entiltled Encrypting Passwords in Iron Speed Designer

 

The last section of his video states to add some code to SignIn.aspx.vb(see below).

This code does not work for SignIn.aspx.cs.

 

Can some please provide me with the correct code for C#?

Thanks in advance!

Code:
If Me.Password.Text.Length > 0 Then 
Me.Password.Text = BaseFormulaUtils.EncryptData(Me.Password.Text)
End If

 

 

Thanks

 

David


__________________
David Nelson
echo4sos

Avatar / Picture

MVP Developer
Registered:
Posts: 172
Reply with quote  #2 
Code:
 

if (this.Password.Text.Length > 0) {
this.Password.Text = BaseFormulaUtils.EncryptData(this.Password.Text);
}


http://www.developerfusion.com/tools/convert/vb-to-csharp/

__________________
-Bill
dnelson241

Registered:
Posts: 30
Reply with quote  #3 

Thanks I appreciate your help! And thanks for the link!!!

David

 


__________________
David Nelson
akeshgupta

Avatar / Picture

Iron Speed MVP
Design, Develop & Deliver

Registered:
Posts: 1,095
Reply with quote  #4 
Thanks Bill for helping out here.  David, the call for authentication does not go thru the DAL, hence we have to encrypt the password again so that the authentication process can do a string match for login.

HTH,

__________________
Akesh Gupta
Light Speed Solutions, LLC.
If I rest, I will rust !   Let's share the knowledge !
dnelson241

Registered:
Posts: 30
Reply with quote  #5 

I noticed later in the day today that the Remember Password function is not working now.  I now get... Invalid login information. Please enter a valid user name and password.

Any ideas on what to look at for that?

Thanks

David

 


__________________
David Nelson
skingley78

Registered:
Posts: 10
Reply with quote  #6 
+1
If you check remember password, this approach does not work. Is it because the password is stored as a cookie (encrypted) and then we are encrypting it again?

__________________
Hugh
viral_ec09

Registered:
Posts: 1
Reply with quote  #7 
public void OKButton_Click(object sender, EventArgs args)
        {

          // Click handler for OKButton.             
          // Customize by adding code before the call or replace the call to the Base function with your own code.
             if (this.Password.Text.Length  > 0)
            {
               this.Password.Text = BaseFormulaUtils.EncryptData(this.Password.Text);
            }
          OKButton_Click_Base(sender, args);
          // NOTE: If the Base function redirects to another page, any code here will not be executed.
        }

Can anbody help me ?

Equivalent VB code works. But above shown C# code does not word.
Any suggestions?
ehsan.haque

Registered:
Posts: 14
Reply with quote  #8 
Hi, I need to implement this urgently and have done as shown on Akesh's video. I am having the same issue with the C# version of the code. It does not seem to work at all. Any new thoughts on this? I am really desperate here!
__________________
Ehsan Haque
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #9 
This is the working code I have in ISD 12.20:

   public void OKButton_Click(object sender, EventArgs args)
        {

          // Click handler for OKButton.
            if (this.Password.Text.Length > 0)
            {
                this.Password.Text = FormulaUtils.EncryptData(this.Password.Text);
            }        
          // Customize by adding code before the call or replace the call to the Base function with your own code.
          OKButton_Click_Base(sender, args);
          // NOTE: If the Base function redirects to another page, any code here will not be executed.
        }

Cheers,
Jimi j

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

ehsan.haque

Registered:
Posts: 14
Reply with quote  #10 
Hi Jimi,

That was brilliant! It's all working now. I probably had the OKButton_Click_Base(sender, args); in the wrong place. Thank you so much for your help.

Now that I have this working, I have a small issue to deal with.

I have a production database where all the passwords are in plain text (I am trying to implement the encryption on this application). It is now working for the new users only as expected but how can I encrypt password that were previously recorded in plain text. I have 6000 + records and I cannot manually update each of the password to have it encrypted. Is there an easy way to achieve this?

Your response would be greatly appreciated.

Thanks again for your time.

Kind regards
Ehsan



__________________
Ehsan Haque
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #11 
We use to create a simple encrypting routine and iterate to convert all records in one click.

Jimi J

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

ehsan.haque

Registered:
Posts: 14
Reply with quote  #12 
Hi Jimi,
Could you please explain a bit if possible. I am thinking of making an update table form selecting all records and writing in the "Initialise value when Editing Record" as 

= EncryptData(Password)

And then save.

Is that feasible?

__________________
Ehsan Haque
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #13 
You need to get the editable recordcontrol of the user table, wrap it with beginning and ending transactions, edit and save as you iterate to each record.

Cheers,
Jimi J

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement