StrataFrame Forum

Log os used passwords

http://forum.strataframe.net/Topic32089.aspx

By Marcelo Blank - 6/6/2013

Hi All,

One again, for compliance´s propouses, I need to have a log of the last ten used passwords of each user.

Is it native of the tool ? How can I get it ?

Regards
By StrataFrame Team - 6/6/2013

Yes, SF automatically stores the last 24 passwords used by a user.  The collection is private, but you could access it through reflection or by modifying the source code to make the SFSUsersBO.EncryptedData class public. The EncryptedData class parses the us_Data field in the database, which is where all of that information is stored.  The EncryptedData has the PasswordHistory property, which is a generic string list of the last 24 passwords used.
By StrataFrame Team - 6/6/2013

The reason we store the password history is so that SF can prevent a user from re-using any of their last X passwords, where X is configured through the SFSPreferences.sp_PwBeforeRepeat field value.  It is configured through the security preferences.  

So, if you're trying to duplicate that functionality, just set the preference.  If you need a user-readable log of the passwords, then you'll have to get it from the EncryptedData class.
By Marcelo Blank - 6/6/2013

Great.

That´s what I tought.

Thanks


By Marcelo Blank - 6/6/2013

That´s it.:

1 - Turn the class EncryptedData public 

''' <summary>
        ''' Data processing of Users.us_Data field
        ''' </summary>
        ''' <remarks></remarks>
        Public Class EncryptedData

2 - Compile the SFSUsersBO dll

3 - replace the SFSUsersBO dll in your project

4 - Add this code ...

SFSPreferencesBO s = new SFSPreferencesBO();

s.FillAll(ProjectPK); 

SFSUsersBO u = new SFSUsersBO();

u.FillByPrimaryKey(UserPK); 

            for (int i = 0; i <= u.us_PasswordHistory.Count-1; i++)
            { 
                MessageBox.Show(u.us_PasswordHistory[i].ToString());

            }

5 - Well done.

Thanks a lot
By StrataFrame Team - 6/7/2013

Glad that worked for you Marcelo Smile