Prerequisites
- An Apple Developer account
- SnackBase installed and running on a domain with HTTPS (Apple requires HTTPS)
Step 1: Create an App ID
- Log in to the Apple Developer Console
- Go to Certificates, Identifiers & Profiles > Identifiers
- Click + to add a new identifier
- Select App IDs, continue
- Select App, continue
- Enter a Description and Bundle ID
- Scroll down to Capabilities and check Sign In with Apple
- Click Continue and Register
Step 2: Create a Service ID
- Go back to Identifiers
- Click +, select Service IDs, continue
- Enter a Description and Identifier (e.g.,
com.example.snackbase.client) - Click Continue and Register
- Click on the newly created Service ID to edit it
- Enable Sign In with Apple and click Configure
- Select your Primary App ID
- Add your Web Domain (verify ownership if required)
- Add your Return URLs (Redirect URIs)
- Format:
https://<your-domain>/api/v1/auth/oauth/apple/callback
- Format:
- Click Save, Continue, and Save
Step 3: Create a Client Secret (Private Key)
- Go to Keys
- Click + to create a new key
- Enter a name and check Sign In with Apple
- Click Configure, select your Primary App ID
- Click Save, Continue, and Register
- Download the
.p8file (save this securely, you cannot download it again) - Note the Key ID
- Get your Team ID from the top right of the developer console
Step 4: Configure SnackBase
In SnackBase, configure the Apple provider:| Field | Value |
|---|---|
client_id | Your Service ID Identifier (from Step 2) |
team_id | Your Apple Team ID |
key_id | The Key ID (from Step 3) |
client_secret | The contents of your .p8 private key file |
redirect_uri | The Return URL from Step 2 |
scopes | name email (default) |
Testing
- Save your configuration
- Attempt to sign in via the Apple button on the login page
Troubleshooting
The
.p8 private key file is only available for download once. Store it securely as you cannot retrieve it again.- invalid_client: Check that your client_id (Service ID), team_id, and key_id are correct
- HTTPS required: Apple requires HTTPS for all callbacks
- Domain verification: Ensure your domain is verified in Apple Developer Console
Related Guides
- OAuth Overview - Understanding the OAuth flow
- Google OAuth Setup
- GitHub OAuth Setup