Repository navigation
v0.28.0
Native sign-in with Apple and Google
v0.28.0 lets a mobile app sign in with the platform's own sheet (Sign in with Apple, Google sign-in) instead of a browser tab. The app sends the ID token it gets to the server, which checks it and signs the user in.
New
POST /api/v1/auth/{collection}/oauth2/id-tokentakes{ provider, id_token, nonce, name }forappleorgoogle. The server checks the token's signature against the provider's published keys, its issuer, expiry and audience, and each token signs in only once. The answer is the same as the browser flow's: a session,merge_requiredwhen the email belongs to an existing account, ormfa_requiredfor an account with two-factor on. Users who sign in with Google on the web and in the app are the same user.POST /api/v1/auth/{collection}/oauth2/id-token/noncereturns a single-use nonce (10 minutes) for the sign-in sheet. Required for Apple; optional for Google, whose Flutter plugin sets the nonce once per launch.- New settings
oauth2.apple.native_client_ids(the app's bundle ID) andoauth2.google.native_client_ids(the iOS and Android client IDs) list the apps whose tokens are accepted, besides the provider'sclient_id. Both are in the admin under Settings → OAuth2.
The Dart / Flutter SDK has it as signInWithIdToken; see Native Apple and Google sign-in and the API reference.
Upgrade notes
- Nothing to do. If Apple or Google sign-in is already enabled, the new endpoint accepts ID tokens issued to its
client_idstraight away (still single-use, still checked); add the apps' IDs tonative_client_idsto accept theirs. The upgrade notes for v0.27.0 apply if you are coming from an earlier version.
Full Changelog: v0.27.3...v0.28.0