Apple OAuth setup for Authverse projects
This page details how to add and configure Apple OAuth for Authverse projects.
Execute the following command to add the Apple provider to your project:
npx authverse@latest oauth appleTo support Apple Sign-In, you need to configure your app in the Apple Developer Portal:
http://localhost:3000/api/auth/callback/applehttps://example.com/api/auth/callback/apple.p8 file). Note the Key ID and your Team ID.Add the following variables to your project's .env file:
APPLE_CLIENT_ID=
APPLE_CLIENT_SECRET=
APPLE_BUNDLE_ID=.p8 key if your adapter supports it).[!NOTE] The Authverse CLI automatically adds
https://appleid.apple.comto yourtrustedOriginsinauth.tsto ensure seamless authentication flow.
Import the prebuilt provider component and integrate it into your UI:
import { AppleOAuthButton } from "@/components/authverse/AppleOAuthButton";
<AppleOAuthButton />;This component renders the Apple sign-in button at its location.
Return URLs in the Apple Developer Portal exactly match your deployment.https://appleid.apple.com to be in your trusted origins list.APPLE_BUNDLE_ID is set to your native app's bundle identifier.