Content MarketingMarketing Tools

Google Cloud: How to Add A Google Login To Your Corporate WordPress Site

My company utilizes both Google Workspace and WordPress, so I wanted to make it easy for the team to log into the website using Google OAuth. A couple of caveats to this before I get started:

  • Internal Use: I only want users within our domain to access our site, not external users. That simplifies this because my project won’t need to be approved by Google Cloud.
  • Users: My users were already set up in WordPress, where the user’s email address matches the Google Workspace user’s email address. There is an option to allow registrations to create new users, but I didn’t want to do that (for now).

There are many paid integration solutions for single sign-on (SSO) and/or OAuth, but I don’t think it’s necessary to pay in this case. I found a great plugin called Log in with Google that appears to be supported well, and it worked perfectly for my scenario.

Add a Project in Google Cloud for Your OAuth

The difficult part isn’t setting up the plugin; it’s logging into Google Cloud’s console and creating your project. Google Cloud has so many features and settings that it’s easy to get lost in there. The documentation on the plugin and on Google Cloud isn’t so great, so I thought I’d walk you through it here.

  1. Register and Login to Google Cloud – If you’ve never done that before, you’ll need to accept the terms to get started and create an organization to work under. Navigate to the API console.
  2. Add a New Project
Google Cloud: Add New Project
  1. OAuth Consent Screen (App information) – Ensure you’re working within your project by selecting it from the top of the page (not sure why Google wouldn’t take you directly there!) and then fill out all of the necessary information.
OAuth consent screen Step 1
  1. OAuth Consent Screen (Update selected scopes) – Add the Scope permissions you’ll need for OAuth to work. These are ...auth/userinfo.email and ...auth/userinfo.profile. Click Update.
  • Google Cloud OAuth Scope Permissions - Add
  • Google Cloud OAuth Scope Permissions - Add
  1. OAuth Consent Screen (Confirm) – Confirm your settings.
google cloud console oauth consent screen confirm
  1. Credentials – On the left menu, select Credentials. From the top menu, select Create Credentials and select OAuth client ID.
Google Cloud Credentials
  1. Create OAuth client ID for the application type Web application.
Google Cloud - Create OAuth client ID for Web application.
  1. Create OAuth client ID – Name your web application and then enter the redirect, which should be your URl followed by /wp-login.php.
Google Cloud - Create OAuth client ID add redirect URI
  1. Create your credentials – and you’ll get a popup with your Client ID and Client Secret. Keep those handy; they’ll need to be entered in the plugin settings.

Activate the Log in with Google WordPress Plugin

The plugin is no frills and is straightforward. There’s not a lot of documentation around it, though, so I wanted to provide the visual steps above.

  1. Enter your Client ID from Google Cloud.
  2. Enter your Client Secret from Google Cloud.
  3. Select whether or not you’d like to create new user if that email address isn’t registered.
  4. Enable One Tap Login to directly login to WordPress Admin.
  5. Enable whether you’d like this to work only on the Login Screen or throughout the site wherever someone is logging in.
  6. Add your domain.
wordpress plugin google login
  1. Save Changes and you’re good to go!
  2. Log out of WordPress, use the Google Login, and you’ll be able to authenticate for your WordPress site:
Google Login to WordPress

Douglas Karr

Douglas Karr is a fractional Chief Marketing Officer specializing in SaaS and AI companies, where he helps scale marketing operations, drive demand generation, and implement AI-powered strategies. He is the founder and publisher of Martech Zone, a leading publication in marketing technology, and a trusted advisor to startups and enterprises… More »
Back to top button
Close

Adblock Detected

We rely on ads and sponsorships to keep Martech Zone free. Please consider disabling your ad blocker—or support us with an affordable, ad-free annual membership ($10 US):

Sign Up For An Annual Membership