I'm creating an application that will need to store and, later retrieve, to display that information to a user. This information will be considered sensitive and could include a temporary password for a particular site for an employee. I believe I understand that password should be just stored with their hash and then you can check to see if the input's hash matches what you have stored in your database.
My question is: Ethically storing this information in plain text seems sketchy at best if not something as a programmer I consider borderline illegal. How I can store this information and retrieve it later? Sites like last pass accomplish this but I'm not creating a password manager nor is that something that I think I can accomplish and say, "Yes, this is secure the user's passwords will never been seen except by the user". What other methods would be viable for this?
Some features I'm thinking about including is having the logins for the users be wiped after x amount of days or even after they are used but there is still a window of opportunity for those passwords to be stolen. Anything else I could include or do differently? Is there a possibility where I could prevent these passwords being on the database at all?