forcedotcom / postman-salesforce-apis

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

General Question on Web Server Flow 1 #74

Open ajayts opened 2 months ago

ajayts commented 2 months ago

When trying the Web Server Flow 1, I am getting the output but its not clear how to get the code. I am using Postman to test this to ultimately get the refresh token by using the code from this in the POST Web Server Flow 2.

Any pointers you can help provide would be grateful.

pozil commented 2 months ago

Hi @ajayts, these request allow you to run the OAuth 2.0 Web Server Flow for Web App Integration. The code that you're looking for is sent to a callback URL specified by the redirect_uri query parameter in the first request. We use the redirectUrl Postman collection variable to set its value.

ajayts commented 2 months ago

Thanks @pozil . I am trying to get the code to be able to run the Web Server Flow 2. I have set the redirect URL as https://www.google.com in both the connected app and in the Postman variable. Ultimately I am trying to find the right way to get the code from Web Server Flow 1 to be able to set in Web Server Flow 2. Am I doing this wrong?

pozil commented 2 months ago

It doesn't work like this. The redirect URL must point to a custom app that is able to receive the callback request and extract the code programmatically (Google can't). This custom app is then responsible for requesting the token via the second query with the code and the connected app credentials.