forcedotcom / postman-salesforce-apis

Salesforce API Postman Collection
Creative Commons Zero v1.0 Universal
1.06k stars 638 forks source link

Requests to get Refresh Token #31

Closed jotraverso closed 3 years ago

jotraverso commented 3 years ago

Requests to get Refresh Token

Added requests to obtain Authorization Code previous to get Access and Refresh tokens following the instructions found here https://medium.com/@bpmmendis94/obtain-access-refresh-tokens-from-salesforce-rest-api-a324fe4ccd9b

salesforce-cla[bot] commented 3 years ago

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Jorge Ortega j***@r***.net. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce.com Contributor License Agreement and this Pull Request will be revalidated.

scolladon commented 3 years ago

Hi @jotraverso !

Thanks for your pull request. I wonder if those calls correspond to already existing ones ?

Seb

jotraverso commented 3 years ago

Hi @scolladon,

It's a good point :)

Let me suggest to set up the _refreshToken environment var in the test script of the Web Server Flow 2

pm.environment.set("_accessToken", jsonData.access_token); pm.environment.set("_refreshToken", jsonData.refresh_token); pm.environment.set("_endpoint", jsonData.instance_url); pm.environment.set("_userId", id.pop()); pm.environment.set("_orgId", id.pop());

I cannot promise, but I'll try to submit a new pull request for this improvement, think you can close.

Jorge Ortega.

scolladon commented 3 years ago

That's a very good idea @jotraverso !

I think it could also be done in the User Agent Flow right ?

scolladon commented 3 years ago

duplicated by #32