Setting Custom Login Servers in iOS Apps
For special cases—for example, if you’re a Salesforce partner using
Trialforce—you can redirect your user’s login requests to a custom login URI.
In iOS apps, login servers are often called login hosts. Mobile SDK defines standard login URIs for production and sandbox servers in the SalesforceSDKCore project. These two login hosts appear in the Choose Connection login screen.
For iOS, the default login host can potentially be set through any of the following means.
- MDM enforced
- At startup, your app’s MDM provider configures the login URI.
- The MDM policy can also hide the navigation bar and Settings icon to prevent users from changing the login host.
- App configuration through the info.plist file
- Your app can configure the default login URI in the project’s info.plist properties file. The login host property name is SFDCOAuthLoginHost.
- At startup, the SFDCOAuthLoginHost setting overrides user-defined login hosts.
- By default, SFDCOAuthLoginHost property is set to “login.salesforce.com”.
- Do not use a protocol prefix such as “https://” when specifying the login URI.
- User configuration through the Add Connection screenHere’s how a user can configure a custom login server.
- Start the app without logging in.
- In the login screen, tap the Settings, or ”gear,” icon
in the top
navigation bar. - In the Choose Connection screen, tap the Plus icon
. - (Optional but recommended) To help identify this configuration in future visits, enter a label.
- Enter your custom login host’s URI. Be sure to omit the https:// prefix. For example, here’s how you enter a typical
Experience Cloud site
URI:
1MyDomainName.my.site.com/fineapps