Create an Apple Auth. Provider in Salesforce for a Mobile Publisher App

Configure your org to recognize Apple as the external authentication provider.

Required Editions

Setup for Mobile Publisher available in: Lightning Experience
Setup for Mobile Publisher available in: production only (not sandbox)
Available in Lightning Experience in: Enterprise, Performance, and Unlimited Editions
User Permissions Needed
To create and modify a Mobile Publisher project: Manage mySalesforce Apps
To view the settings: View Setup and Configuration
To edit the settings:

Customize Application

AND

Manage Auth. Providers

You’re prompted for the Team ID and Services ID that you created from your Apple developer account.

  1. From Setup, enter Auth. Providers in the Quick Find box, then click Auth. Providers.
  2. Click New.
  3. For Provider Type, select Apple.
  4. Enter a name for your Auth. Provider.
  5. Enter a URL suffix, which is used in the client configuration URLs. For example, if the URL suffix of your provider is MyAppleProvider, your SSO URL is similar to https://mydomain_url or site_url/services/auth/sso/MyAppleProvider.
  6. Enter the Team ID from Apple. It appears on the Apple App ID configuration page.
  7. Enter your Services ID from Apple. It appears on the Services ID configuration page under the Identifier field.
  8. Create Key ID and Key according to Create a private key to access a capability in Apple Help.
    1. From Apple, create a private key, choosing Sign In with Apple capability. Apple generates a Key ID, which appears on Apple’s Key Details page.
    2. From Apple’s Key Details page, download an Apple-generated file to your computer. This file, which ends in .p8, contains a private key used to sign your JSON authentication tokens.
      Note
      Note Be sure to download the key—even though Apple’s instructions suggest downloading the key is optional. Salesforce requires the key.
    3. Return to your Salesforce Auth. Provider Setup page. Click Upload Key, and select the .p8 file.
  9. For Default Scopes, enter the scopes to send along with the request to the authorization endpoint. See Apple Developer Help for Apple’s default scopes.
    Note
    Note If you don’t supply default scopes, Salesforce uses email name.
  10. To direct callbacks to your subdomain instead of login.salesforce.com, select Use subdomain in callback URLs.
  11. For Custom Error URL, enter the URL for the Apple provider to use to report any errors.
  12. For Custom Logout URL, enter a URL to provide a specific destination for authenticated users after they log out.
  13. To establish a registration handler, click Automatically create a registration handler template. Later, you modify the registration handler for Apple.
  14. For Execute Registration As, select an admin that runs the Apex handler class.
  15. To use a portal with your provider, select the portal from the Portal dropdown.
  16. For Icon URL, select Choose one of our sample icons to open a list of available icons. Select an Apple icon, copy the URL, and then enter it under Icon URL.
    This icon shows up on your site’s login page. Users click it to log in with their Apple ID.
  17. Click Save.

Salesforce displays the Auth. Provider details page, which lists the client configuration URLs generated after creating the Apple auth. provider. See Auth. Provider Client Configuration URLs for Mobile Publisher Apps.