Sign in with Apple in web fails / error: 'invalid_client'

I'm facing issues with Sign in with Apple in my Better Auth setup:

Current Status

  • ✅ Apple Sign In works in my Expo (native) app using ID token
  • ❌ Apple Sign In fails on web
## Configuration Details
  • Using Better Auth with Expo plugin
  • JWT payload for client secret looks correct:
    {
      "aud": "https://appleid.apple.com",
      "iss": "xxx",
      "iat": 1741190805,
      "exp": 1772294802,
      "sub": "de.xxx.web"
    }
  • Web Service ID: de.xxx.web
  • App Bundle ID: de.xxx.app
## Error Messages
Server logs show:
INFO [Better Auth]: If it's a valid URL, please add https://appleid.apple.com to trustedOrigins
ERROR [Better Auth]: Invalid origin: https://appleid.apple.com
ERROR [Better Auth]: { error: 'invalid_client', status: 400, statusText: 'Bad Request' }


I've added https://appleid.apple.com to trustedOrigins as suggested (should not be needed?), but still experiencing web authentication issues. Any ideas what might be causing this discrepancy between native and web authentication?
Was this page helpful?