What's WP
Our everything is about WordPress - best choice of WordPress users!
How to Add Gmail Login to a WordPress Site

How to Add Gmail Login to a WordPress Site

Due to the great convenience, social logins have been adopted on numerous WordPress sites, so that users can log in with their Gmail account, Facebook account, Twitter account, etc. hassle-freely without offering a standalone username and password.

As we have discussed some social login methods before, this time we’d like to introduce the simple one-click Gmail login which allows you and your existing users to access the WordPress admin area with their Gmail accounts.

About Gmail Login for WordPress

One-click Gmail login enables you to log into your WordPress site by clicking on a “Login with Gmail” button or so, which brings much convenience if you have created business email accounts for your team members who are responsible for the management of your WordPress site. For those who have logged in Gmail already, they will get access to your site automatically without username or password required.

Also, you don’t have to worry about the security of Gmail login, because it is quite secure with OAuth, a protocol simplifying the web authorization process without compromising the security.

Add Gmail Login to WordPress

Add Gmail Login to WordPress

In the case that you are interested in the one-click Gmail login and want to apply it to your WordPress site, we’d suggest you take advantage of a plugin named Google Apps Login.

This plugin has a free version which exactly works to add Gmail login to WordPress sites. But if you want to simplify user management with the plugin, you need to pay for the Premium version. Also, you can buy the Enterprise version which allows you to control user roles and access based on the Google Group membership. If you are running a website for an organization like a public company or a school, Google Apps Login is great to use.

Google Apps Login

The installation of this plugin is the same as any other ones, so you can just follow our simple guide. Upon the activation, you will have to complete the settings of the plugin. Here you need to go Settings > Google Apps Login.

Google Apps Login Setup

Set up the plugin

Under the “Main Setup” tab, you are required to enter the Client ID and Client Secret. To get the information you need, you first have to visit the developers console page. Assumed that you have logged in already, on the new page, you should find the Project dropdown, and select “Create project” as is shown below.

Create Project

Then you will see a popup in which you need to name the new project as you like (your site name, for example), agree to the terms (if necessary), and hit the button of “Create”.

New Project

After creating the project, find the “Credentials” menu item in Google API Manager and click on it. Then, click on the “OAuth Consent screen” tab. On the new screen, you have to select a valid email address and enter your website or company name as the product name. Optionally, you can upload a product logo and provide your homepage URL, privacy policy URL, or TOS URL. At last, click “Save”.

OAuth Consent Screen

Now, go back to the “Credentials” tab, open the “Create credentials” dropdown, and choose “OAuth client ID”.

OAuth Client ID

On the new page, select “Web application” as the “Application type” first. Then, enter a custom name as you like. Next, fill in your website URL in the field for “Authorized JavaScript origins”, and the URL of your login page as the “Authorized redirect URIs”. Be sure to make the URLs accurate. Also, remember to click on “Create”.

Create Credentials

Now you will be able to see the credentials you want, which include the Client ID and the secret key.

OAuth Credentials

What to do next is to copy these things to the settings of the Google Apps Login plugin. As soon as you save the changes, the plugin is ready to use.

Set Up Plugin

Further customize the Gmail login

After making the Gmail login working, you can customize it with several settings under the “Advanced Options”. These settings should meet some of your specific requirements. What you can do with these settings include:

  • Forcing your users to confirm the access to their Gmail accounts every time they use Gmail login.
  • Redirecting your users to Google for confirmation.
  • Enabling the Remember Me option.
  • Giving credits to the plugin by displaying a link on your login page.

For the settings, we’d suggest you enable the first one if you want extra security. And for the others, configure them as you like.

Advanced Options

Test Gmail login

When all things are configured properly, log out your account to go back to the login page of your WordPress site. If no error occurs, you should see the following login form with a “Login with Google” link.

WordPress Login Page

Clicking on the link, you will be redirected to Google where you are required to choose your Gmail account (if you have more than one). Then, you need to grant your WordPress website the access to view your email address and your basic profile information. Just click on the “Allow” button, and you will be logged into your website automatically.

Grant Access

Author

Joyce is a professional writer & SEOer who loves trying new things and sharing the experience through blogging. She loves clean design, playing with different WordPress themes, SEO, etc. Now she is very struggle with purchasing a bubbling apartment in downtown. You can help her by clicking our ADs or making a purchase via our links ;-)

Close

Want to Learn More About WordPress?

Get Our Free Themes, Plugins, Support, SEO Tips, and Other Tutorials!

Email *