Skip to main content

How to Configure Apple Login with Arc XP Subscriptions

OAuth providers like Facebook or Google have a relatively straightforward process to register a new application which will give you a client ID and secret ID. Since Apple uses a public/private key client authentication method rather than a traditional client secret, it is a bit more complicated.

Go to Sign-In Apple Developer Portal and click on Resources. Then, click on Configuration Help Read Apple Developer Account Help.

Step 1: Registering a client_ID.

From Apple developer account, you will need to get the Team ID (see How To Find Team ID).

Note

Unlike Google and Facebook, the Apple Developer Program has an annual fee.

Step 2: Copy and paste the Services ID, Key ID, Client Secret, and team ID to Commerce Admin tool.

Also, you will need to insert the “Redirect URL”, which corresponds to a value of your own application.

Step 3: Make sure the Authenticator providers make part of Site Configuration.

Step 4: Adding the Apple button in the SignUp/Login form and calling Identity.InitAppleSignOn

rId33.png
<button type="button" onClick={() => Identity.initAppleSignOn()}>
  Sign In with Apple
</button> 

Step 5: Call Identity.appleSignOn for SignUp and Login

import React, { useEffect } from 'react';
import qs from 'querystring';

import Identity from '@arc-publishing/sdk-identity';

export const AppleRedirect = ({ location: { search }, history }) => {
  const { code } = qs.parse(search.slice(1));
  useEffect(() => {
    const redirect = () => {
      Identity.appleSignOn(code).then(() => {
        history.push('/profile');
      });
    };
    redirect();
  }, [code, history]);
  return <h3>Redirecting...</h3>;
};

AppleRedirect.displayName = 'AppleRedirect';

export default AppleRedirect;

Step 5: Sign In with Apple

Any user who wants to Sign in with Apple will need an Apple ID. In addition, two-factor authentication should be set up (see Two-Factor Authentication For Apple ID).

Sign in with Apple makes it easy for users to sign in to your apps and websites using their Apple ID. All accounts are protected with two-factor authentication for superior security, and Apple will not track users’ activity in your app or website.

Note

Apple users can opt out of sharing their email address when signing in with an Apple ID. If the user chooses to hide their email address, Apple creates a “Unique, Random Email Address Is Created, So (Their) Personal Email Address Isn’t Shared With The App Or Website Developer During The Account Setup And Sign In Process. This Address Is Unique To (The User) And The Developer And Follows This Format: <Unique-Alphanumeric-String>@Privaterelay.Appleid.Com” If the customer contacts support, the agent can look up their account using the relay address created by Apple or other information the customer provided as part of the customer’s Identity account after signing in with Apple.