So one of the basic rules of website authentication is never to write unencrypted passwords to the database. I typically put in functionality to hash passwords when user accounts are created, so that you can't just open up the DB and see the password in a query. But since hashing is one-way, what's the best way for website admins who need access to usernames and passwords in user accounts to retrieve passwords?
I get that if there was a simple way to recover the clear-text password, there would be no point in hashing the passwords to begin with. But say an admin needs to log into the site as a certain user, then maybe the solution is to add a "log in as" feature available only to site admins? Or, if it's not a site that world-class hackers would be interested in, maybe it's okay to use a 2-way encrypt-decrypt system for passwords?