Guide language:

At WWDC 2019, Apple announced the use of Apple Logins, which is an alternative to third-party logins — a mechanism long offered by Facebook, Twitter, Google and others. At the time, I was working on an application with the ability to log in using Facebook and Google. And because I found the documents I logged in with my Apple account confusing, I couldn’t implement it in the application I was developing.

A few weeks ago, the App I was working on was finally available to upload to the App Store. I tested everything and sent it to Apple for review. Sadly, the app was rejected and I got a reply from Apple saying THAT I had to implement “log in with Apple” in the app.

That’s when the real challenge begins. I perused all the documentation Apple provided (which only led to more confusion), sample projects, videos and other blogs – and finally figured it out.


In this article, I’ll show you how to do this using An Apple login in an iOS application with Django on the back end. But until then, please note that “Log in with Apple” is only available on iOS 13 and later, and can only be implemented using Xcode 11 or later. Now, let’s get started.

Basically, the whole implementation process can be divided into three parts:

  1. Configure the key and identifier
  2. A backend for implementing logins
  3. Realize apple ID login in app

Configure the key and identifier

The first step in setting up “Log in with Appl” is to add “Log in with Apple” to the iOS app’s feature list. There are two possible scenarios for this step:

  1. Select Auto Manage Signature (Auto signature)
  2. Unselected AutoManage Signature (Manual signature)

Case 1: Automatic Management signature (automatic signature) is selected:

If you check AutoManage Signatures under Signatures, that means we have less work to do. Xcode will manage everything else. In this case, we must:

  1. Go to Xcode’s project navigator.
  2. Select the Xcode project.
  3. Select the desired target.
  4. Go to the Signature and Features TAB.
  5. Click the + function button.
  6. Select Log in using Apple. By completing the above steps, you will complete the automatic signing method that adds new functionality to your application. In the autosignature approach, Xcode adds the use of Apple login functionality to rights, syncs with the developer portal, and automatically generates new configuration files for you. Therefore, your key and identifier configuration is complete.

Case 2: AutoManage Signature is not selected (Manual signature)

However, if you deselect the AutoManage Signature option, you choose to sign manually and must follow the following steps:

  1. Go to Xcode’s project navigator.
  2. Select the Xcode project.
  3. Select the desired target.
  4. Go to the Signature and Features TAB.
  5. Click the + function button.
  6. Select Log in using Apple.

After completing these steps, the remaining steps are as follows: 7. Add “Log in with Apple” to the app ID: In this step, you need to complete the following tasks:

  • Log in to Apple Developer Portal, and then select Identifier.
  • Select the application in which you want to add “Log in with Apple”.
  • Scroll down to log in using Apple, and then select the check box.
  • Click Save.

By default, this application ID is enabled as the primary application ID. (Optional) If you use multiple application or network authentication, you may want to assign them as a component to the application ID.

  1. Rebuild the configuration file: Since we have changed the application ID, the existing configuration file will be invalid. Therefore, we need to regenerate them following the given steps:
  • Go to your profile.
  • Click on each configuration file associated with the application ID, and save again.
  • It can be downloaded manually from the portal or through Xcode.

Now that the identifier has been created and downloaded, all the Settings are complete to implement logging in with the Apple account in our iOS application.

However, since we want the iOS app to communicate with the back end server when someone tries to log in using “Log in with Apple account”, we have to have the back end ready. To get the back end ready, the first thing we need to do is the key. Now, let’s create a key for the back end:

  • Log in to the Apple Developer Portal.
  • Go to the key, and then click Create Key.
  • Give it a name, check the Log in with Apple check box, and then click Configure.
  • Select your application ID, and then click Save.
  • Click to continue
  • Click Register to generate the key

    Click Download to download the key file, and then click Finish.

    You can click the keys in the list displayed in the Keys section to see details, including including the key ID again. The key ID we generated will be used later in the back-end implementation.

Now we can move on to the second step, the development of the back-end code.