-
-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add experimental signInWithIdToken
for Apple, Google
#603
Conversation
When using this endpoint, I'm getting a 502 |
Been working on integrating Apple and seeing this I've reached out to support@supabase.com yesterday regarding this issue, so hopefully someone can look into what's causing this. edit: no longer seeing the |
@jaytxng I'm emailing someone from support back and forth about this. The way I was originally Signing in with Apple and Google failed due to server changes. I'm trying this out and yeah I'm getting the 502 |
Also: please don't merge this in without making sure it works |
Hi @DanMossa we haven't merged this in yet because the gotrue version on the Supabase platform is still on v2.40.1, which doesn't contain the changes in supabase/gotrue#927. |
@DanMossa heads up, I'm no longer seeing that 502 error anymore 😄 |
Yup! After talking to support they disabled the endpoint. They just had to re enable it! |
🎉 This PR is included in version 2.12.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi All - thanks for bringing this back. I've been trying to get it working with google auth and getting an error |
Yup! I'm using it now. Are you passing a nonce when using Sign in with Google? Does the JWT token you get from Google contain a nonce? |
Thanks for the reply! I didn't actually realize the id token was a JWT but
it looks like it does actually contain one - does that mean on the client I
should decode the JWT then pass that nonce into the argument? I had
(obviously incorrectly) assumed that the nonce would be in payload response.
…On Sat, Feb 25, 2023 at 9:51 PM Daniel Mossaband ***@***.***> wrote:
Hi All - thanks for bringing this back. I've been trying to get it working
with google auth and getting an error Passed nonce and nonce in id_token
should either both exist or not. Is this expected to work with google?
Yup! I'm using it now. Are you passing a nonce when using Sign in with
Google?
Does the JWT token you get from Google contain a nonce?
—
Reply to this email directly, view it on GitHub
<#603 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADFWNFPWLQLHVAYXUMOYRDWZLAL5ANCNFSM6AAAAAAUPHQPM4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Update: I tried pulling the nonce out of the JWT manually and passing it in
the nonce arg but now getting an "Invalid nonce" error 🤦♂️
…On Sat, Feb 25, 2023 at 9:57 PM John Ryan ***@***.***> wrote:
Thanks for the reply! I didn't actually realize the id token was a JWT but
it looks like it does actually contain one - does that mean on the client I
should decode the JWT then pass that nonce into the argument? I had
(obviously incorrectly) assumed that the nonce would be in payload response.
On Sat, Feb 25, 2023 at 9:51 PM Daniel Mossaband ***@***.***>
wrote:
> Hi All - thanks for bringing this back. I've been trying to get it
> working with google auth and getting an error Passed nonce and nonce in
> id_token should either both exist or not. Is this expected to work with
> google?
>
> Yup! I'm using it now. Are you passing a nonce when using Sign in with
> Google?
>
> Does the JWT token you get from Google contain a nonce?
>
> —
> Reply to this email directly, view it on GitHub
> <#603 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AADFWNFPWLQLHVAYXUMOYRDWZLAL5ANCNFSM6AAAAAAUPHQPM4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
I am having the same issue: Passed nonce and nonce in id_token should either both exist or not. I am using this one https://github.com/CodetrixStudio/CapacitorGoogleAuth and get something like this:
When I pass the Idtoken to signInWithIdToken I get error: Passed nonce and nonce in id_token should either both exist or not. If I decode the idToken I can get the nonce, but when I pass it in I got error: invalid nonce |
Hi the same error Passed nonce and nonce in id_token should either both exist or not. @laotala828 how you decode nonce in id token ? |
You can paste your idtoken in the JWT site https://jwt.io/ and it can show you a decoded object. |
Has anyone been able to get around the Currently using Edit: |
Hey @robertn702 I did not solve this problem, but I do have a solution to allow user to Oauth log in on iOS. Previously I used React Native and now I am using Capacitorjs, it works for both. For RN you use the Linking feature, and for Capacitor you use the appUrlOpen event on App. Basically you ask users to open the gotrue endpoint url in browser, for example:
You can set SIGN_IN_CALL_BACK as the URL scheme of you app, for example Then after users signing in or up using google oauth, they will be redirected to your app, and you will get a string url like this
Finally you call the seSession function and you will get the info you need and log users in. |
@laotala828 how were you able to set the redirect url correctly? In supabase I have a web redirect url and in google cloud I can't add an app specific url scheme since google enforces to create a dedicated iOS client secret. |
The method I mentioned is using the web client secret in GCP, you don't need an iOS client secret. |
Adds
signInWithIdToken
as experimental. This brings back the ID token login flow for Sign in with Apple and Sign in with Google for iOS and Android apps.It's marked as experimental since there are some known issues with this endpoint, but we do realize the importance of having this method available as Sign in with Apple is mandatory on iOS devices.