Create a Connected App
A Salesforce administrator creates connected apps on the Salesforce server. Salesforce connected apps include many settings that are used only by other mobile offerings such as the Salesforce app. The following steps cover the settings that apply to Mobile SDK apps.
To create a connected app:
- Log into your Salesforce instance.
- In Setup, enter
Apps
in the Quick Find box, then select Apps. - Under Connected Apps, click New.
- Perform steps for Basic Information.
- Perform steps for API (Enable OAuth Settings).
- If applicable, perform the optional steps for Mobile App Settings.
- Click Save.
If you plan to support push notifications, see Push Notifications and Mobile SDK for additional connected app settings. You can add these settings later if you don’t currently have the necessary information.
After you create your connected app, be sure to copy the consumer key and callback URL for safekeeping. You use these values in Mobile SDK apps for OAuth configuration. To look them up later in Lightning Experience:
- In Lightning Experience, go to Setup.
- Navigate to Apps | App Manager.
- Select an unmanaged connected app (where App Type equals Connected).
- Click the dropdown button at the right end of the row and select View.
- For basic Mobile SDK apps, the callback URL doesn’t have to be a valid URL; it only has to match what the app expects in this field. You can use any custom prefix, such as
sfdc://
. - To support advanced authentication, the callback URL must be a valid endpoint using your custom URI scheme.
- For IdP use cases, the callback URL must be a valid endpoint using the HTTPS protocol.
- The detail page for your connected app displays a consumer key. It’s a good idea to copy this key, as you’ll need it later.
- After you create a new connected app, wait a few minutes for the token to propagate before running your app.
Specify basic information about your Mobile SDK app in this section.
-
Enter a connected app name and press Return. The name you enter must be unique among connected apps in your org and may contain spaces.
Salesforce automatically fills in the API Name field with a version of the name without spaces.
-
Enter a contact email.
Other basic information fields are optional and are not used by Mobile SDK.
- Select Enable OAuth Settings.
- Enter the callback URL (endpoint). Mobile SDK uses this URL to call back to your application during authentication. This value must match the OAuth redirect URI specified in your app’s project configuration.
- For Selected OAuth Scopes, select Access and manage your data (api), Perform requests on your behalf at any time (refresh_token, offline_access), and Provide access to your data via the Web (web).
- To support Mobile SDK apps that perform authentication through the device’s native browser, deselect Require Secret for Web Server Flow.
Most settings in this section are not used by Mobile SDK. Here are the exceptions.
- To support PIN protection, select PIN Protect.
- To support push notifications, select Push Messaging Enabled. You can find instructions for this section at Step 2: Creating a Connected App in the Salesforce Mobile Push Notifications Implementation Guide.
Create a Connected App in Salesforce Help.
See Also