The problem I have is that I want to implement a RESTful back end, where the user needs to authenticate on every request for accessing a back end resource, using a server generated token. What happens is that when using the standard login on my website (email + password), this token gets generated on the server by my own application and is then sent to the front end where it is stored (all transactions happen over https).
So I thought about using the access token that I receive from Facebook to store it in my back end, if the user wants to log in using Facebook. This way, every RESTful request to the back end could be checked against this token.
My question is:
How can I safely store a token in my back end, after the user authenticated with Facebook?