Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
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)
edited by

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 the particular server to authenticate to salesforce and retrieve the session id, and then via some internal API share this information with other instances.

Want to get certified in Salesforce? Here is the Salesforce Online Training you are looking for!

Browse Categories