Apple social sign in
You can enable users to sign up and sign in using their Apple credentials.
⚠️ Note: Apple limits the information it passes when users sign up this way. Avatars and profile pictures do not flow through to the auth experience in Kinde.
What you need
Link to this section- An Apple Developer account including a subscription to the Apple developer program
- Your Kinde callback URL (see below)
- Some developer know-how
Copy the callback URL from Kinde
Link to this section- In Kinde, go to Settings > Authentication.
- If you have not yet added the Apple connection, select Add connection, select Apple, then Save.
- On the Apple auth tile in the Social authentication section, select Configure.
- In the Callback URL section:
- If you use Kinde’s domain as your default, copy the Kinde domain URL.
- If you use a custom domain (and want to use it as the callback) select the Use custom domain instead switch and copy the Custom domain URL.
- Use the copied Callback URL to set up the app, see below.
Configure sign in for your app
Link to this sectionℹ️ The following procedures refer to several types of IDs including App ID and Services ID. Take care to follow the steps exactly, to avoid errors.
Set up your app
Link to this section- In your Apple developer account, go to Identifiers.
- Select the plus (+) icon next to Identifiers.
- Select App IDs, then select Continue.
- Select App, then select Continue.
- Enter a description and Bundle ID.
- In the Capabilites list, select Sign in with Apple.
- Select Register.
Register services
Link to this section- Select the plus icon (+) next to Identifiers.
- Select Services ID, then select Continue.
- Enter a description and identifier (make a note of this because it will be used as the Client ID).
- Select Register.
Configure domains
Link to this section- Click on the newly created service to edit.
- Check the box to enable Sign In with Apple and click Configure.
- In the Domains and Subdomains field, enter your Kinde URL, e.g.
yourdomain.kinde.com(excluding the https:// protocol) - In the Return URLs field, enter your Kinde callback URL, e.g.
https://yourdomain.kinde.com/login/callback - Select Next, then select Done.
- In the Edit your Services ID Configuration window, select Continue, then select Save.
Set up keys
Link to this section- Select Keys in the left hand menu and click the plus icon (+) next to the page title.
- Enter a Key Name.
- Select Sign In with Apple and next to this option, select Configure.
- Select your app from the Primary App ID field, then select Save.
- Select Continue then select Register.
- Download your key as per the screen instructions. You will need this to generate the client secret.
- When you have downloaded the key, select Done.
Generate the client secret
Link to this sectionThere are several ways to generate the client secret. An example is provided below.
Example using Ruby
You can use open source libraries for creating and signing JWT tokens for your client secret (see JWT.io). The below steps provide an example of accomplishing this using Ruby.
-
Install jwt using the following command:
gem install jwt. -
Create a file titled
client_secret.rband replace the empty values in your script as follows:-
key_fileis the p8 file containing your private key that you downloaded. -
team_idcan be found in the top right of your apple developer account under your name. -
client_idis the identifier used for the service. -
key_idwas provided on the key creation screen.require 'jwt'key_file = 'key.txt'team_id = ''client_id = ''key_id = ''ecdsa_key = OpenSSL::PKey::EC.new IO.read key_fileheaders = {'kid' => key_id}claims = {'iss' => team_id,'iat' => Time.now.to_i,'exp' => Time.now.to_i + 86400*180,'aud' => 'https://appleid.apple.com','sub' => client_id,}token = JWT.encode claims, ecdsa_key, 'ES256', headersputs token
-
-
Run the script with ruby
client_secret.rband copy the generatedclient_secret. -
Add these credentials into Kinde.
Add credentials to Kinde
Link to this section- In Kinde, go to Settings > Authentication.
- On the Apple tile, select Configure.
- Paste the Client ID (Service ID) and Client secret (Private key) into the relevant fields.
- Select which apps will use Apple sign in.
- Select Save. Users will now see Apple as an option to sign up and sign in to your product.
Renew Apple token periodically
Link to this sectionTo continue to enable users to sign in with Apple, you will need to periodically renew the Apple token by generating a new client secret. Usually every six months. To do this, repeat the procedures from Set up keys to Add credentials to Kinde, above.
Third party references for this article
Link to this sectionWe do our best to test all our procedures, but sometimes third party companies change things without us knowing. Here’s the sources we used to create this article.