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
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.
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.
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.
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”.
Now, go back to the “Credentials” tab, open the “Create credentials” dropdown, and choose “OAuth client ID”.
Now you will be able to see the credentials you want, which include the Client ID and the secret key.
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.
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.
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.
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.