Closed anoyab closed 8 years ago
I was wanting to achieve the same, but I figured out Salesforce is a bit special compared to any other service, having sandbox environments different from production environment. In no other environment, there is the same and the guys from Passport didn't really imagined this "edge-case".
In order to be able to log into a sandbox, you have to overwrite these 2 lines https://github.com/joshbirk/passport-forcedotcom/blob/master/lib/passport-forcedotcom/strategy.js#L9#L10, basically it's just about defining authorizationURL and tokenURL in your passport.use function. This works well, but if you do that, you're locked into using a sandbox for all your users. No way to use production (not even talking about prerelease, or custom domain).That's not really a limitation from this module, but more from passport, the way the configuration is being defined. Alternatively, this module could be extended to allow different configuration, one for each kind of Salesforce environment by specifying a special name for each of them: https://github.com/joshbirk/passport-forcedotcom/blob/master/lib/passport-forcedotcom/strategy.js#L14, which you would then use in passport.authenticate('sandbox'/'production'/...). But that would be quite dirty to say the least....
Thanks
works very well but I need to use in sandbox environment it's possible?