Skip to main content

How to set up Sign in with Apple

Sign in with Apple lets customers create an account and sign in with their Apple Account. To connect it to the Social Login extension, register your store in your Apple Developer account, then copy four values into the extension settings: a Services ID, your Team ID, a Key ID and the private key.

Requirements
  • A membership in the Apple Developer Program, with the Account Holder or Admin role.
  • Magento 2.4.4 or later. Sign in with Apple needs the phpseclib/phpseclib 3 library, which Magento includes from version 2.4.4; without it, the Apple button is not shown.
  • A store on a public domain, served over HTTPS. Apple does not accept localhost, IP addresses or http:// addresses.

1. Create an App ID with Sign in with Apple​

A Services ID for a website has to be grouped under an App ID that has Sign in with Apple enabled. If you already have an App ID for your iOS app with Sign in with Apple enabled, skip to the next step and use it.

  • In your Apple Developer account, open Certificates, Identifiers & Profiles, click Identifiers in the sidebar, then click the add button (+).
  • Select App IDs, click Continue, and click Continue again on the App ID type.
  • Enter a Description, select Explicit App ID, and enter a Bundle ID, for example com.example.store.
  • Under Capabilities, select Sign in with Apple.
  • Click Continue, then Register.

2. Create a Services ID​

The Services ID identifies your store to Apple.

  • In Identifiers, click the add button (+), select Services IDs, and click Continue.
  • Enter a Description and an Identifier, for example com.example.signin. This identifier is the value of the Services ID setting in the extension.
  • Click Continue, then Register.

3. Add your store to the Services ID​

  • In Magento, go to Stores -> Configuration -> Mirasvit Extensions -> Social Login, expand Apple, and copy the Redirect URI.
  • In Apple's Identifiers list, open the Services ID you created, select Sign in with Apple, and click Configure.
  • In Primary App ID, select the App ID from step 1.
  • Under Website URLs, add your store's domain without https://, for example example.com, and the Redirect URI you copied. If the form shows separate Domains and Subdomains and Return URLs fields, enter the domain in the first and the Redirect URI in the second.
  • Click Done, Continue, then Save.
tip

The Redirect URI is built from the store view's base URL. If your store views use different domains or store codes in the URL, switch the configuration scope to each store view and add each Redirect URI.


4. Create a private key​

  • In Certificates, Identifiers & Profiles, click Keys in the sidebar, then click the add button (+).
  • Enter a Key Name and select Sign in with Apple. Click Configure, select the App ID from step 1 as the Primary App ID, and click Save.
  • Click Continue, then Register.
  • Click Download to save the key as a .p8 file, and note the Key ID shown on the page.
warning

Apple lets you download the key only once. Keep the .p8 file in a safe place; if you lose it, create a new key.


5. Find your Team ID​

Your 10-character Team ID is shown in the Membership details of your Apple Developer account.


6. Configure the extension​

  • Go to Stores -> Configuration -> Mirasvit Extensions -> Social Login and expand Apple.
  • Set Enabled to Yes.
  • Fill in Services ID, Team ID and Key ID.
  • In Private key, paste the full contents of the .p8 file, including the BEGIN PRIVATE KEY and END PRIVATE KEY lines. The key is stored encrypted, and line breaks lost while pasting don't matter.
  • Click Save Config and clear the Magento cache.

The Sign in with Apple button now appears on the storefront.

Hyvä storefronts

On a Hyvä theme, rebuild the theme's styles after installing or upgrading the extension, so the Apple button gets its colours and icon.


Customer names and private email addresses​

  • Names. Apple shares the customer's name only the first time they sign in to your store. When no name is available, the extension uses the part of the customer's email address before the @ as their first and last name. Customers can change their name in their account.
  • Hide My Email. Customers can choose to share a private relay address ending in @privaterelay.appleid.com instead of their real email. Apple forwards mail to these addresses only from senders you register. To make sure order and account emails reach these customers, register the domains your store sends email from under Sign in with Apple for Email Communication in your Apple Developer account, as described in Apple's guide to the private email relay service.