Solution skill
Native Google/Apple sign-in with idTokens (no web OAuth)
Complete solution
Shows how to fix native Google/Apple sign-in with idTokens (no web OAuth). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Issue nhost/nhost#2554 (closed, 22 comments): When working with apps (Flutter or native), we often use native authentication methods with Google and Apple. Nhost added a native sign-in endpoint for mobile apps, so web OAuth is no longer required for Google/Apple sign-in.
Steps
- Issue nhost/nhost#2554 (closed, 22 comments): When working with apps (Flutter or native), we often use native authentication methods with Google and Apple. Those methods return an idToken and an accessToken. Authentication providers such as Firebase Authentication allow us to send those tokens as an OAuth response, thus authenticating a user. Nhost only allows OAuth web authentication, which is not suitable for native apps, especially with Apple.
- Nhost added a native sign-in endpoint for mobile apps, so web OAuth is no longer required for Google/Apple sign-in. Call POST /signin/idtoken with: provider (apple or google, required), idtoken (required), nonce (optional, unhashed; recommended if your idToken includes one, to guard against replay attacks), plus the same options object used by other sign-up methods. React Native SDK and example app support is in nhost/nhost#3000.
When to use
You are seeing this: Those methods return an idToken and an accessToken. Use this skill when you run into "Native Google/Apple sign-in with idTokens (no web OAuth)".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/nhost/nhost/issues/2554
Evidence
In https://github.com/nhost/nhost/issues/2554, the reporter asked: Issue nhost/nhost#2554 (closed, 22 comments): When working with apps (Flutter or native), we often use native authentication methods with Google and Apple. Those methods return an idToken and an accessToken. Authentication providers such as Firebase Authentication allow us to send those tokens as an OAuth response, thus authenticating a user. Nhost only allows OAuth web authentication, which is not suitable for native apps, especially with Apple. The verified answer: Nhost added a native sign-in endpoint for mobile apps, so web OAuth is no longer required for Google/Apple sign-in. Call POST /signin/idtoken with: provider (apple or google, required), idtoken (required), nonce (optional, unhashed; recommended if your idToken includes one, to guard against replay attacks), plus the same options object used by other sign-up methods. React Native SDK and example app support is in nhost/nhost#3000. Source thread: https://github.com/nhost/nhost/issues/2554
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_XXR20JY3tOfQrFW4aluhpA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Native Google/Apple sign-in with idTokens (no web OAuth) <span>— Vectle</span></a>