Add Sign in with Apple as a social identity provider
Note
Last verified against the provider console: October
2, 2026. Apple steps use Certificates, Identifiers &
Profiles
Sign in with Apple requires four artifacts: an App ID, a Services ID (your Amazon Cognito client ID), a private key, and your Team ID. You then add Apple as an identity provider (IdP) in your user pool. You must enable managed login first.
Create your Apple identifiers and key
To create the Apple artifacts
-
In Certificates, Identifiers & Profiles, create an App ID (Identifiers, then +, then App IDs, then App) and enable the Sign in with Apple capability.
-
Create a Services ID (Identifiers, then +, then Services IDs). Enter a description and a reverse-domain identifier, for example
com.example.auth.cognito. This identifier is your Amazon Cognito Services ID (client ID). -
Select the Services ID, enable Sign in with Apple, and choose Configure. Choose your primary App ID, then enter the web URLs:
-
Domains and Subdomains (host only, no scheme):
<your-prefix>.auth.<region>.amazoncognito.comfor the default Amazon Cognito domain, orauth.example.comfor a custom domain. -
Return URLs (full URL with
https://):https://<your-prefix>.auth.<region>.amazoncognito.com/oauth2/idpresponse, orhttps://auth.example.com/oauth2/idpresponsefor a custom domain.
-
-
Create a private key (Keys, then +), enable Sign in with Apple, and download the
.p8file. You can download it only once. Record the Key ID. -
Record your 10-character Team ID from the Membership page. You enter the Services ID, Team ID, Key ID, and private key when you add Apple to your user pool.
Add Apple to your user pool
To add Apple as an IdP in the AWS Management Console
-
In the Amazon Cognito console
, choose your user pool, then Social and external providers, then Add an identity provider, then Sign in with Apple. -
Enter the Services ID, Team ID, Key ID, and private key. Amazon Cognito uses the private key to generate the client secret for you.
-
For Authorized scopes, enter
email name. Use onlyemailif you don't need the user's name. -
Map
emailtoemailandsubto your user name attribute. Apple returns the user's name only on the first sign-in, so capture it then if you map it. -
Choose Add identity provider, and enable Apple on your app client.
Test Sign in with Apple
Open your managed login sign-in page and choose Continue with Apple. Test both Share My Email and Hide My Email.
Checkpoint
The browser returns through /oauth2/idpresponse to your app with an
authorization code. A user appears in your user pool with the
SignInWithApple provider and a sub. The Share
My Email run shows the real email; the Hide My Email run shows a
@privaterelay.appleid.com address. An invalid_client
error almost always means the client-secret JWT has expired or the Services ID or
Return URL doesn't match /oauth2/idpresponse exactly.
Apple-specific pitfalls
- The client secret is a JWT that expires
-
Apple's client secret is not a static string. It's an ES256-signed JWT with a maximum lifetime of six months (15,777,000 seconds), and when it expires, Apple sign-in breaks with
invalid_clientand no warning. In the configuration described here, you give Amazon Cognito the private key (along with the Services ID, Team ID, and Key ID), and Amazon Cognito generates the client-secret JWT from that key—you don't paste a pre-built secret. Keep the private key you registered with Apple valid and current in the IdP configuration; if you revoke or replace the Apple key, update the IdP (for example, withUpdateIdentityProvider) with the new key. - Private relay email and account linking
-
When a user chooses Hide My Email, Apple returns a
@privaterelay.appleid.comaddress instead of the real one. This address differs from the email the same person uses with other providers, so don't link accounts across identity providers by email when Apple is involved—link by the providersubinstead. To send mail to a relay address, register your sending domains under Sign in with Apple for Email Communication. - email_verified type and managed accounts
-
Apple's
email_verifiedclaim can arrive as the string"true"or the booleantrue—handle both. It's always true for consumer Apple Accounts. For Apple at Work & School (managed) accounts it can be false. Prefersub-based linking and normalize the string value before any merge logic.