Skip to content

Instantly share code, notes, and snippets.

@joshbirk
Created February 25, 2015 16:48
Show Gist options
  • Save joshbirk/7cdbab355fc63570c672 to your computer and use it in GitHub Desktop.
Save joshbirk/7cdbab355fc63570c672 to your computer and use it in GitHub Desktop.
var sfStrategy = new ForceDotComStrategy({
clientID: CF_CLIENT_ID,
clientSecret: CF_CLIENT_SECRET,
callbackURL: CF_CALLBACK_URL,
authorizationURL: SF_AUTHORIZE_URL,
tokenURL: SF_TOKEN_URL
//the current sample lists the first param as "Token", but it's really an OAuth object Look at the params field on it.
}, function(oauth, refreshToken, profile, done) {
// asynchronous verification, for effect...
process.nextTick(function() {
//so if we want to store the oauth info, now is our chance.
//instance_url added here since you need that to properly form Force.com API endpoints
profile.options = {
Authorization: oauth.params.access_token,
token_secret: refreshToken,
instance_url: oauth.params.instance_url
};
delete profile._raw;
return done(null, profile);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment