verbb / social-login

A Craft CMS plugin to add SSO (Single Sign-On) user login, registration and connecting to social media platforms.
Other
4 stars 6 forks source link

Integration of Google One Tap login with the Google login provider #39

Open jamesevans1808 opened 1 month ago

jamesevans1808 commented 1 month ago

Question

I'm trying to get the Google One Tap auth functionality (the little pop up that appears in the top right of the page if you're logged into your Google account in your browser) working with the Google login from this plugin. I'm just unsure what URL I should be passing in as the login uri, as the formie.io one for local development doesn't seem to work. Here's an example of the snippet I am using to set it up below, with data-client_id and data-login_uri replaced due to being sensitive data:

<div id="g_id_onload"
     data-client_id="a.apps.googleusercontent.com"
     data-context="use"
     data-login_uri="https://formie.verbb.io?return=https://cms.test.loc/actions/social-login/auth/callback"
     data-auto_select="true"
     data-close_on_tap_outside="false"
     data-itp_support="true">
</div>
<script src="https://accounts.google.com/gsi/client" async></script>

Any help would be greatly appreciated, even if it is just integrating this with Craft.

Many thanks

Additional context

https://developers.google.com/identity/gsi/web/guides/offerings

https://developers.google.com/identity/gsi/web/tools/configurator

engram-design commented 1 month ago

I've not had experience with Google One Tap login, but I'll look into it!

jamesevans1808 commented 1 month ago

I've not had experience with Google One Tap login, but I'll look into it!

Nice one, thank you! I did make some headway in implementing it myself, but I ended up banging my head against a wall when it came to proper verification of the token.

jamesevans1808 commented 3 weeks ago

@engram-design

I've managed to get this working outside of the social login plugin following the instructions listed here: https://developers.google.com/identity/gsi/web/guides/verify-google-id-token#php

Hopefully this is helpful for you guys as it was for me.