Apple OAuth
Sign in with Apple.
Required by Apple's App Store guidelines if you offer any other social sign-in. The configuration is more involved than Google or Facebook because Apple uses a private-key-signed JWT for client authentication.
Server config
Add the optional peer dep:
Generating credentials
- In Apple Developer, create a Service ID — this is your
clientId. - Enable "Sign In with Apple" on it. Add your redirect URI.
- Create a Key, enabling "Sign In with Apple". Download the
.p8file. The Key ID iskeyId; the Team ID isteamId. - Convert the
.p8to a single-line env var (replace newlines with\n).
Endpoint
| Method | Path | Body |
|---|---|---|
POST | /auth/login | { providerName: 'apple', credentials: { token } } |
token is the Apple identityToken returned by their JS SDK or native frameworks.
Client call (web)
Email-relay quirk
Apple lets users hide their real email behind a relay address (abc123@privaterelay.appleid.com). The library stores whatever Apple returns. If you need the real email, you have to ask the user separately — Apple won't give it to the library.