I know, I know, cleartext passwords are terrible and you should always store a hash!
However, I'm interested in all of the issues with storing cleartext passwords so I can make a reasonably secure choice. Are there any issues other than the obvious two??
- Many people reuse their passwords and you're putting them at risk
- An attacker can now login as the user to your site (although couldn't they just change the hash in the database to be a new password at that point / they already have access to all the information anyways?)
Motivation: If the password in question is randomly generated and only used by the server to authenticate on behalf of the user to a service (an attempt at "single sign-on"), the primary reuse risk is negated. If an attacker compromised the database, they'd be able to login directly to the 3rd-party service. But if having your database compromised at all is orders of magnitude worse than having an attacker gain access to the 3rd-party service, is it still an issue?
DETAILS ADDED FROM COMMENT:
I'm trying to authenticate from a server with health information on it to a 3rd-party Jabber server, so the client never has to know login credentials to the Jabber server. Then authenticated tokens can be passed from the server to the client so the client can communicate directly with the Jabber server.
Obviously, access to the health data in the database is orders of magnitude more disastrous than gaining access to the Jabber service.
I'm trying to be careful here because I'm very wary of cleartext, but it seems like the best approach in this particular situation.