1

There's a general consensus on how to store passwords if you have to validate them yourself (i.e. hash + salt (+ pepper)). However, I am building an application which logs users in into some service X to do actions A, B, C repeatedly for them.

How would one store passwords in this case? Even if they are encrypted, there has to be a 1-to-1 conversion if one wants to log them into service X.

Rainymood
  • 309
  • 3
  • 12

1 Answers1

1

There is no safe way to store passwords that can be decrypted into their plain text form.

The OAuth2 protocol offers a solution for your use case.

It asks the user to authenticate and then issues your application an access token (and potentially a refresh token) that allows your application to access or act upon the behalf of the user.

Community
  • 1
  • 1
MvdD
  • 22,082
  • 8
  • 65
  • 93