I'm creating a little application where users must authenticate with Facebook (I'm using OAuth2). At this moment all of this procedure looks like this:
- The user will click on "FB Login" button.
- The user will be asked to login to Facebook and allow permission. If user allows it will return an authorization code.
- Now we will use the authorization code to get an access token.
- We can store the access token in session to start a user session.
- Now we can use the access token to access to different user resources.
And here I have question - Is it best (ie the safest way) to store the access_token
for later use? "Hide" it simply to the database and take it when it's needed or can it develop some original hash algorithm to secure it?