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 Answer 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .