1

We have a application that uses Salesforce OAuth for user login. Our application is hosted on Heroku and we are using Heroku pipelines to deploy review apps.

For every review app in Heroku a new dyno is created with its own url. The problem is that the connected app setup in Salesforce needs a static callback url that is defined.

As the urls for review apps is not deterministic we can't specify a callback url for review apps and also not sure a workaround to get OAuth working.

Any suggestions?

1

Although you are required to use a static callback URL Salesforce respects an optional state parameter when making the initial OAuth request, which you could use to store the dynamic review app URL.

Your static callback URL could lead to a Heroku app (or publicly accessible Force.com site) that accepts the authorization code and state parameters from Salesforce's initial response and then retrieves the Salesforce access token before finally redirecting the user to the original review app with the access/refresh tokens.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.