Apple social sign in
You can enable users to sign up and sign in using their Apple credentials.
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 custom domains, select the Use custom domain instead switch.
- If you have only one custom domain, copy the Custom domain URL. If you have custom domains for multiple organizations, select each one from the list and copy the callbacks for each. You need to enter all custom domain callbacks in the provider app.
- Use the copied Callback URLs to set up the app, see below.
Configure sign in for your app
Link to this sectionThe 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 or custom domain callback URL, e.g.
https://yourdomain.kinde.com/login/callback
. - Add additional entries for all your organization custom domain callbacks, e.g.
account.customdomainone.com/login/callback
,account.customdomaintwo.com/login/callback
, etc. - 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.rb
and replace the empty values in your script as follows:-
key_file
is the p8 file containing your private key that you downloaded. -
team_id
can be found in the top right of your apple developer account under your name. -
client_id
is the identifier used for the service. -
key_id
was provided on the key creation screen.
-
-
Run the script with ruby
client_secret.rb
and 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 if you want to treat this connection as a trusted provider. A trusted provider is one that guarantees the email they issue is verified. We recommend leaving this off for maximum security.
- 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.