owin-middleware/OwinOAuthProviders — pull request #20 by scottedwardhill (2014-07-16 21:29:40+00:00)
Title: support for refresh token in Salesforce provider

It looks like the merge of branch 'payojbaral-master' re-added the Salesforce files to the project, so they are actually in there for v 1.6. I have been using 1.6 and have been able to establish an Oauth connection to Salesforce with my external app. One thing that would be useful to have access to is the refresh token that is returned in the call, which is the basis for this pull request. This will allow you to obtain new access tokens once the original one expires. Access token expiration is based on the session timeout setting defined in the Salesforce install.

Setting up a connected app in Salesforce is fairly straightforward - you can sign up for a developer org here https://developer.salesforce.com/en/signup, and then follow these instructions to set up a connected app: https://www.salesforce.com/us/developer/docs/api_rest/Content/intro_defining_remote_access_applications.htm. If you want your app to be able to use a refresh token, it will only be returned if you specify the "Perform requests on your behalf at any time (refresh_token, offline_access)" scope in the connected app's definition in Salesforce.