I'm using omniauth-salesforce gem to access salesforce data in my rails app. I'm able to login to salesforce using oauth and get the authorization code back in my app in no time. But how do I get the access token for further REST calls.
3
votes
1 Answers
0
votes
OAuth2 tokens expire after a certain duration. You can cache these bearer tokens per user per session (perhaps as a cookie?).
You will also want to capture the refresh token. The access token could expire while the user is still interacting with you. If so, you can use the refresh token to get a new access token without user intervention.
More details on OAuth2 can be find in the RFC 6749 definition.