dtmtec / restforce-bulk

Client for Salesforce Bulk API
MIT License
7 stars 45 forks source link

How do you authenticate? #2

Closed rossmeissl closed 8 years ago

rossmeissl commented 8 years ago

I'm used to creating Restforce clients with

client = Restforce.new username: USERNAME,
                       password: PASSWORD,
                       security_token: SECURITY_TOKEN,
                       client_id: CONSUMER_KEY,
                       client_secret: CONSUMER_SECRET

and then using client.describe etc. to interact with the API. What do I do differently with Restforce::Bulk?

rossmeissl commented 8 years ago

@gustavokloh any thoughts?

gustavokloh commented 8 years ago

@rossmeissl You should do nothing differently.

As you can see here (https://github.com/dtmtec/restforce-bulk/blob/master/lib/restforce/bulk/client.rb#L9) we're using Restforce to authenticate.

So, if you have the env variables with credentials, that's ok.

rossmeissl commented 8 years ago

Thanks @gustavokloh, I was trying to figure out how to declare the auth params in code (versus in the environment), but I gave up and used the environment auth method and it worked fine.

gustavokloh commented 8 years ago

@rossmeissl :D

You can declare auth params in code. But you can instantiate the client with params and pass to Restforce::Bulk

I preffer environment vars.