Callback URLs/Redirect URIs¶
In OAuth 2.0 authentication, the client—on the end user’s behalf—will send the server a client ID, credentials, scopes, and callback URLs—all of which the server needs in order to properly authenticate a client. The callback URLs, also known as redirect URIs, tell the server where to send the user with the proper tokens after authentication.
For purposes within Skuid, you’ll want the end user sent back to the Skuid site/org accessing the data. So whether you’re using one of Google’s many APIs, modifying data on an external Salesforce org, or accessing a Sharepoint database, you will need to use your Skuid callback URL for every external data source that uses OAuth 2.0 authentication.
Note that you will be entering your callback URL on the settings page of whatever service you are accessing, such as the Google API Console, the Salesforce Connected App page, or the Dropbox API app page. You will not be entering this URL on any Skuid page.
Constructing callback URLs¶
When using Skuid SFX, the callback URL will depend on several things:
- Whether or not the Remove Instance Names from URLs critical update is activated
- If the above critical update is not activated, then the Salesforce org’s instance
- If set, the Salesforce org’s My Domain
- Whether the org is a developer edition or sandbox org
Each of these variables will change parts of the callback URL.
Note
Lightning Experience requires that My Domain be enabled.
There are also different URLs needed based on whether the Skuid page is deployed using the Redirect, the skuid:page Visualforce component override method, or the Skuid Page (Aura) Lightning component. Because of this, it’s best to enter all callback URLs for Skuid SFX orgs within your OAuth applications.
To ensure the accuracy of your callback URLs, fill out the form below to generate the appropriate Salesforce callback URLs for your org:
Why multiple URLs?¶
Because Skuid can be deployed in a variety of contexts within Salesforce, the data returned by your external systems may need to go to one of three URLs to be parsed by Skuid. Those three different deployment contexts, and their associated callback URLs forms, are:
Skuid deployed via the redirect Visualforce method.
This callback URL will look like:
https://my-domain--skuid.visualforce.com/apex/skuid__oauthcallback
Skuid deployed via the skuid:page Visualforce method.
This callback URL will look like:
https://my-domain--c.visualforce.com/apex/oauthcallback
Skuid deployed via the Skuid Page (Aura) Lightning component.
This callback URL will look like:
https://my-domain.lightning.force.com/skuid/oauthcallback.app
Since many OAuth applications allow you to enter more than one callback URL, we always recommend entering all three of your callback URLs to ensure Skuid can retrieve data however it may be deployed within your org.
Troubleshooting¶
Remove Instance Names critical update [[]]¶
Because Salesforce’s Remove Instance Names from URLs for Visualforce, Community Builder, Site.com Studio, and Content Files critical update changes the domain name of Visualforce pages within a Salesforce org, it can also affect any callback URLs used by your data sources.
Before activating this critical update for your Salesforce org, ensure that you have added the appropriate, updated callback URLs to all external systems that Skuid uses OAuth to authenticate to.
See the Skuid SFX callback URL generator above, check the Remove Instance Name Critical Update option, and fill out the form.
For example, the following callback URLs included the instance name before activating the update:
https://acmecontainers--skuid.eu3.visual.force.com/apex/skuid__oauthcallback
https://acmecontainers--c.eu3.visual.force.com/apex/oauthcallback
After enabling the Remove Instance Names… critical update, they would become:
https://acmecontainers--skuid.visualforce.com/apex/skuid__oauthcallback
https://acmecontainers--c.visualforce.com/apex/oauthcallback
It is important that this can affect any data source that uses the OAuth authentication flow, whether that be an org-to-org Salesforce connection, a Google Drive implementation, any Microsoft service connection, etc. If a data source uses OAuth, it requires callback URLs, and thus those callback URLs must be updated.
Note
- The above only affects Skuid SFX instances. Skuid Platform sites and their data sources are not affected.
- This update does not affect the authorize or token endpoint URLs of any data sources.
Changing Salesforce instances [[]]¶
If the Remove Instance Names from URLs critical update is not activated, it’s possible your orgs instance may have changed.
Salesforce occasionally migrates orgs across instances. If your callback URL worked before, but no longer does, ensure that the instance in your Salesforce org URL has not changed.
For example:
https://acmecontainers--skuid.
eu3.visual.force.com/apex/skuid__oauthcallback
may become
https://acmecontainers--skuid.
eu12.visual.force.com/apex/skuid__oauthcallback