Overview
Configure Apple Sign In with your own Apple Developer credentials to enable custom branding for the Apple authentication experience in Embedded Wallets. This guide walks you through creating an App ID, Services ID, private key, and integrating with CDP. Time to complete: ~20-30 minutesApple Sign In setup is more complex than Google or X OAuth due to additional requirements like private key generation and Services ID configuration.
Prerequisites
Before you begin, ensure you have:- Apple Developer account: Enrollment costs $99/year at developer.apple.com
- CDP Project ID: Available in your CDP Portal dashboard
- Access to CDP Portal: Permission to configure Embedded Wallets settings
Step 1: Create an App ID
- Navigate to the Apple Developer Portal
- Go to Certificates, Identifiers & Profiles
- Select Identifiers from the sidebar
- Click the + button to create a new identifier
- Select App IDs and click Continue
- Select App as the type and click Continue
-
Fill in the App ID details:
- Description: A descriptive name (e.g., “My App - Embedded Wallets”)
- Bundle ID: Choose “Explicit” and enter a reverse-domain identifier (e.g.,
com.yourcompany.app)
- Under Capabilities, enable Sign in with Apple
- Click Continue, then Register
The Bundle ID you create here will be referenced when creating the Services ID in the next step. Save this identifier for reference.
Step 2: Create a Services ID
- Still in Identifiers, click the + button again
- Select Services IDs and click Continue
-
Fill in the Services ID details:
- Description: “CDP Embedded Wallets Service” (or custom description)
- Identifier: Enter a unique identifier, different from your App ID (e.g.,
com.yourcompany.app.services)
- Check Sign in with Apple
- Click Continue, then Register
- Back in the Identifiers list, click on your newly created Services ID
- Check Sign in with Apple and click Configure
-
In the configuration dialog:
- Primary App ID: Select the App ID you created in Step 1
- Domains and Subdomains: Enter
api.cdp.coinbase.com - Return URLs: Click the + button and add:
- Click Next, then Done
- Click Continue, then Save
- Copy your Services ID (e.g.,
com.yourcompany.app.services) - this is your Client ID
Step 3: Create a private key
- In the Apple Developer Portal, select Keys from the sidebar
- Click the + button to create a new key
-
Configure the key:
- Key Name: “CDP Embedded Wallets Key” (or custom name)
- Check Sign in with Apple
- Click Configure next to “Sign in with Apple”
-
In the configuration dialog:
- Primary App ID: Select the App ID from Step 1
- Click Save
- Click Continue, then Register
-
Download the key:
- Click Download to save the
.p8file - Copy the Key ID (10-character alphanumeric string displayed on the page)
- Click Download to save the
- Click Done
Step 4: Gather required information
Before configuring CDP Portal, collect all the required values:| Field | Description | Example | Where to find it |
|---|---|---|---|
| Client ID | Your Services ID | com.yourcompany.app.services | Step 2, item 11 |
| Team ID | Your Apple Developer Team ID | A1B2C3D4E5 | Top right of Apple Developer Portal |
| Key ID | ID of the private key you created | X9Y8Z7W6V5 | Step 3, item 6 |
| Private Key | Contents of the .p8 file | -----BEGIN PRIVATE KEY-----\n... | Open the .p8 file in a text editor |
Step 5: Configure CDP Portal
Now that you have all the required credentials, configure them in the CDP Portal:Configure Apple Sign In in CDP Portal
Configure Apple Sign In in CDP Portal
- Navigate to the CDP Portal
- Select your project
- Go to Embedded Wallets > Authentication
- Find the Apple section
- Toggle Apple to on
- Enter your configuration values:
- Client ID (Services ID):
com.yourcompany.app.services - Team ID: Your 10-character Team ID
- Key ID: Your 10-character Key ID
- Signing Key: Paste the entire contents of your
.p8file, including the-----BEGIN PRIVATE KEY-----and-----END PRIVATE KEY-----lines
- Client ID (Services ID):
- Click Save Changes
Step 6: Verification
Test your Apple Sign In configuration:- In your application, ensure you’re calling the Apple sign-in method (see SDK Integration below)
- Click “Sign in with Apple”
- Verify that users can complete the Apple authentication flow
- Check that the user successfully signs in and their wallet is accessible
Apple Sign In can be tested on any device or browser. Unlike some OAuth providers, Apple doesn’t require adding test users during development.
SDK Integration
Integrate Apple authentication in your application using CDP’s SDK:The SDK automatically uses your custom Apple Sign In configuration when available. No code changes are needed when switching from CDP’s default to your custom Apple OAuth application.
Production considerations
Private key security
Private key security
Your
.p8 private key file is extremely sensitive and must be protected:- Never commit to version control: Add
.p8files to your.gitignore - Secure storage: Store in a secrets manager (AWS Secrets Manager, HashiCorp Vault, etc.)
- Limited access: Only authorized personnel should have access to the private key
- Rotation policy: Consider rotating keys periodically (every 6-12 months)
- Backup: Keep a secure backup of the key file in case you need to reconfigure
- Immediately revoke the key in Apple Developer Portal
- Create a new key and update CDP Portal
- Investigate the security breach
Key rotation
Key rotation
Apple recommends rotating private keys periodically:
- Create a new key: Follow Step 3 to generate a new private key
- Update CDP Portal: Replace the old Key ID and Private Key with new values
- Test thoroughly: Verify authentication works with the new key
- Revoke old key: Once confirmed working, revoke the old key in Apple Developer Portal
Email privacy handling
Email privacy handling
Apple allows users to hide their email addresses using “Hide My Email”:
- Private relay emails: Users can choose a randomly generated email (e.g.,
[email protected]) - Forward to real email: Apple forwards messages to the user’s real email
- Unique per app: Each app gets a different private relay email for the same user
- User control: Users can disable email forwarding at any time
- Accept and store private relay emails as you would any email
- Don’t try to validate private relay email format
- Allow users to update their email in your app settings
- Handle bounce backs gracefully if email forwarding is disabled
App review and compliance
App review and compliance
Apple may require app review in certain scenarios:
- Associated Domains: If implementing Apple Sign In on iOS/macOS, you need associated domains configured
- Sign in with Apple button: Must follow Apple’s Human Interface Guidelines
- Account deletion: If Apple Sign In is your only auth method, you must provide account deletion
Troubleshooting
Error: invalid_client
Error: invalid_client
Cause: The Client ID (Services ID), Team ID, or Key ID is incorrect.Solution:
- Verify the Client ID (Services ID) in CDP Portal matches your Services ID from Apple Developer Portal
- Verify the Team ID is correct (check top right corner of Apple Developer Portal)
- Verify the Key ID matches the key you created
- Ensure no extra spaces or characters were copied
- Double-check that all values are from the same Apple Developer account
Error: invalid_request - redirect_uri
Error: invalid_request - redirect_uri
Cause: The return URL in your Services ID configuration doesn’t match the redirect URL.Solution:
- In Apple Developer Portal, go to your Services ID
- Click Configure next to “Sign in with Apple”
- Verify the Return URLs includes exactly:
https://api.cdp.coinbase.com/platform/v2/end-users/auth/oauth/apple/callback - Check for trailing slashes, http vs https, and typos
- Save changes (may take a few minutes to propagate)
Error: invalid_key
Error: invalid_key
Cause: The private key, Key ID, or Team ID don’t match, or the key has been revoked.Solution:
- Verify you copied the entire contents of the
.p8file, including BEGIN and END lines - Check that the Key ID in CDP Portal matches the key you downloaded
- Verify the Team ID is correct
- Ensure the key hasn’t been revoked in Apple Developer Portal (check Keys section)
- If the key was revoked, create a new one and update CDP Portal
Error: Email not provided
Error: Email not provided
Cause: The user chose to hide their email using “Hide My Email”.Solution:
- This is not an error - accept the private relay email provided by Apple
- Store the private relay email (e.g.,
[email protected]) as the user’s email - Apple will forward messages sent to this address to the user’s real email
- Allow users to update their email in your app if needed
Error: Domain not verified
Error: Domain not verified
Cause: The domain
api.cdp.coinbase.com is not configured in your Services ID.Solution:- In Apple Developer Portal, go to your Services ID
- Click Configure next to “Sign in with Apple”
- Under “Domains and Subdomains”, ensure
api.cdp.coinbase.comis listed - If not present, add it and save
- Wait a few minutes for changes to propagate
Authentication works but wallet doesn't load
Authentication works but wallet doesn't load
Cause: This is likely an issue with your CDP configuration, not Apple Sign In.Solution:
- Check CDP status page for potential outages
- Verify your CDP Project ID is correct in your application
- Ensure you’re using the latest SDK version
- Check that the user’s email (or private relay email) is being properly passed to CDP
- Contact CDP support if the issue persists