Skip to content
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

Add Google one tap auth #386

Closed
Tracked by #5
rishabhpoddar opened this issue Mar 7, 2022 · 7 comments
Closed
Tracked by #5

Add Google one tap auth #386

rishabhpoddar opened this issue Mar 7, 2022 · 7 comments

Comments

@rishabhpoddar
Copy link
Contributor

No description provided.

@rishabhpoddar
Copy link
Contributor Author

Closing in favour of #386

@yvesbuschor
Copy link

@rishabhpoddar I see this issue is linking to itself. Is there any other issues or documentation around Google One Tap

@cvetojevichbojan
Copy link

cvetojevichbojan commented Jul 27, 2023

Maybe it would be worth up voting the One Tap request in the Node backend sdk? supertokens/supertokens-node#88

I am thinking of trying to implement this via a custom provider.

@rishabhpoddar
Anyhow we do need this, as Google is suggesting using the One Tap Sign instead of the old sign in process that is linked from the supertokens documenation. And it simplifies the UX of signup / signin, while also eliminating the redirection link, we would just pass the Google ID token to the supertokens backend sdk and it can perform the validation and extract the user info.

https://supertokens.com/docs/thirdpartyemailpassword/custom-ui/thirdparty-login
https://developers.google.com/identity/sign-in/android/start-integrating

@rishabhpoddar
Copy link
Contributor Author

We already have a demo app for this: https://github.com/supertokens/supertokens-auth-react/tree/master/examples/with-thirdparty-google-onetap

@cvetojevichbojan
Copy link

cvetojevichbojan commented Jul 27, 2023

Thanks! Not sure how i missed it...

I would then just suggest to update the documentation for the 3rd party login: https://supertokens.com/docs/thirdpartyemailpassword/custom-ui/thirdparty-login

Specifically you should sync the Android and iOS sections for Flow 2: Via OAuth / Access token, currently its a bit confusing, i was under the impression that Google One Tap Sign in is not supported since the Android specific documentation points back to the Flow 1a -> Step 2: Which uses the redirectUri's in the backend api request example.

"redirecURIInfo": {
        "redirectURIOnProviderDashboard": "<YOUR_API_DOMAIN>/auth/callback/apple",
        "redirectURIQueryParams": {
        ...

Accidentally then i clicked on the under Flow two on the iOS tab and then i saw two new steps under Flow 2 :) which show the correct usage of the ID token in the backend api request:


"thirdPartyId": "google",
    "clientType": "...",
    "oAuthTokens": {
        "access_token": "...",
        "id_token": "..."
    },

If i am getting everything right :)

I believe it could be helpful for others as well, as this is an important feature for "Mobile API backends" that are considering using supertokens as an internal auth system and exposing it via their own API for mobile applications (which in turn will have their own custom UI and not relying on SuperTokens SDK in their app code)

Thanks for such great work!

@shashank-soluteLabs
Copy link

Maybe it would be worth up voting the One Tap request in the Node backend sdk? supertokens/supertokens-node#88

I am thinking of trying to implement this via a custom provider.

@rishabhpoddar Anyhow we do need this, as Google is suggesting using the One Tap Sign instead of the old sign in process that is linked from the supertokens documenation. And it simplifies the UX of signup / signin, while also eliminating the redirection link, we would just pass the Google ID token to the supertokens backend sdk and it can perform the validation and extract the user info.

https://supertokens.com/docs/thirdpartyemailpassword/custom-ui/thirdparty-login https://developers.google.com/identity/sign-in/android/start-integrating

@cvetojevichbojan can you please let me, how had you implemented it?

@cvetojevichbojan
Copy link

Hi @shashank-soluteLabs i used the implementation example provided by rishabhpoddar, but what it boils down to is just sending the one-tap-token to the backend sdk in a similar fashion as in the documentation.

Here is the example for google:

After receiving the "token" from google sdk, you would send it to your supertokens backend sdk for signup (for ex. localhost:10000/auth/signinup) in the following format:

{
    "thirdPartyId": "google",
    "oAuthTokens": {
        "id_token": "token_received_from_google_sdk"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants