Access to user password programmatically


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
As you might remember (or not... Smile ) I have this whole "project" based app going. I just realized that when I allow the user to change projects, I need to login them in again in order to refresh there permission (that was a fun 3 hrs figuring out what was wrong). I'd prefer to just do this programmatically, logging the same user back on, which means I'd need their user name and password to pass to SetLoggedInUser. How do I retrieve this info? I know the password is encrypted in a field in the user table, but how do I get it?
StrataFrame Team
S
StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)StrataFrame Developer (4.7K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You can use the SFSUsersBO to retrieve the value.  The SecurityBasics.CurrentUser.UserPK will give you the primary key for the user and you can create a new SFSUsersBO and FillByPrimaryKey() to get the user record.  The password is then accessible through the PasswordPlainText property.  Of course, once you have the customer record in the SFSUsersBO, you could then just call LoggedInUser.SetLoggedOnUser() and just pass it the SFSUsersBO with the record... this will cause the permissions to be retrieved and the CurrentUser object (and therefore the permissions) to be refreshed; so you really don't need the password once you have the record.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Cool! Thanks!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search