title: How to store OAuth 2 access tokens in a database?
body: <p>I have seen a lot of threads on this but nothing concrete on how to do so.</p>
  
  <p>I am currently getting a user to authenticate with a 3rd party via OAuth2 and I am getting an access token in return.</p>
  
  <p>I would like to store this access token for a long time and so I am using a database to do so.</p>
  
  <p>My question regards what to do with this database entry to ensure security.</p>
  
  <p>I cannot hash it (as I would a password) as I need to be able to read and use the original to call the 3rd party on behalf of the user.</p>
  
  <p>So, I am left with leaving it as is, finding a 2-way encryption method (is there a best/recommended npm package?) or another solution that I am unaware of.</p>
  
  <p>I am not experienced with security regarding access tokens - so do not know the best route to take, and would appreciate any insight provided.</p>
  
  <p>Thanks</p>