I'd like to allow users of a web application with bcrypted passwords and session-based authentication the ability to grant our tech support team access to their account for a time, with the option to manually revoke access. Is there a secure way to approach this problem?
I'm using a LAMP stack.
Ideally, the access could be granted manually (such as when a user is on the phone with us) or automatically (such as when a user emails us via our application or posts in our support forum).
One approach I can imagine would look like this:
- The user clicks a button in the application to allow tech support access to their account.
- The browser would send a request to the server that would store the user's session identifier, CSRF token, etc. in our support database.
- The support database would let support technicians find the customer they are speaking with, and subsequently use the same session identifier, etc., to log in to the user's account.
- Manually revoking access would remove the session identifier from the support database.
But, it necessarily limits the tech support to the session length, which may not be long enough—especially in the case of email support.
Is there a better or more standard way of approaching this problem?
EDIT 1: I could do something like generate a new token that would allow a technician to login via a backdoor, but I'd prefer to avoid backdoors if at all possible.
I suppose another possibility would be to give a wide-open backdoor that's only accessible via an SSH tunnel to the servers. Still a backdoor, but at least very limited in who can access it.