Lesson notes
How it works
How Google login works with Memberstack
When a member clicks Continue with Google, Memberstack sends them to Google to sign in. Google then sends them back to Memberstack's callback address with proof of who they are, and Memberstack logs them in or creates their account. For that handoff to work, Google needs an OAuth app that trusts Memberstack's callback, and Memberstack needs that app's client ID and client secret.
There is now a quicker path: enable Google in Memberstack without entering a client ID or secret, and it uses Memberstack's own credentials. The steps below are the custom setup, which you need if you want the login under your own Google project.
Setting up the Google Cloud side
Google's console labels move around, so follow the names below rather than the exact position on screen.
- In the Google Cloud Console, create a new project.
- Go to APIs & Services, OAuth consent screen. Fill in the app name and support email, choose External as the audience, add a developer contact email and create it.
- Create an OAuth client ID with Web application as the application type.
- Under Authorized redirect URIs, add
https://client.memberstack.com/auth/callback, orhttps://memberstack-client.yourdomain.com/auth/callbackif you've set up a custom domain in Memberstack. - Copy the client ID and client secret.
- Under Branding, add your domain to Authorized domains.
- Under Audience, publish the app when you're ready for the public. While it's in testing, only test users you add can log in, up to 100.
Connecting Google in Memberstack and Webflow
In Memberstack, go to Settings, Auth Providers and click Configure next to Google. Paste the client ID and client secret, turn Google on and save.
In Webflow, the Google button must sit inside a Memberstack signup form, the form with data-ms-form="signup". Memberstack's Social Auth Components include light and dark Google buttons with the attributes already set. If you build your own, add data-ms-auth-provider="google" to it. Members who already have an account are logged in when they use the signup form. To let login forms create new accounts too, add data-ms-social-auth-allow-signup to your login form or login modal buttons.