Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Salesforce by (11.9k points)

We are trying to build an external application/Connected App over Salesforce and are using OAuth 2.0 Webserver flow to retrieve the access tokens and refresh tokens. We created the callback URI with the localhost URI path and this works fine for us.

However, in production, we have multiple instances with different hostnames and they will each need a callback URI to be registered. There will many such instances that may be auto-created dynamically and we won't know ahead of time what the hostnames will be. Also, adding a callback URI for every instance doesn't seem like a scalable solution for us.

Is there a way to create a dynamic callback URI for Connected Apps? Or any other mechanism that will help us retrieve the access token and other OAuth details?

1 Answer

0 votes
by (32.1k points)

Well, I really don't think it is achievable to dynamically modify callback URI of the connected App (my guess this is done for security reasons).

Speaking of alternative routes - first thing that comes into my mind is adding a layer between salesforce and your server instances to act as a gateway. For example, you can use particular server to authenticate to salesforce and retrieve session id, and then via some internal API share this information with other instances.

Browse Categories