Create a Login App On Google for WordPress

Author:

Webtonative

5 February, 2024

To Create a Login App On Google for WordPress

https://console.cloud.google.com/apis/credentials

Follow the following steps to Create an OAuth client ID

  • Click On Credentials
  • Click on Create Credentials
  • Click On OAuth Client ID

Screenshot 2024-02-15 102353.png

File the form

  • Select Web Application as the Application type
  • Enter your website/company name in the Name field

Screenshot 2024-02-15 102524.png

Whitelist Following domain and Uris

  • Suppose https://my-wordpress-domain.com is the domain of your WordPress hosting
  • Add https://my-wordpress-domain.com in Authorised Javascript Origin
  • Add https://my-wordpress-domain.com/wp-json/webtonative/social-login/verify/google, In Authorised Redirect URIS
  • click on create.

Screenshot 2024-02-14 at 6.10.45 PM.png

  • On the Next screen, you will find your newly created client ID and client secret to use for Integrating Google login on the website.

Screenshot 2024-02-15 103012.png

  • Copy the client id, and client secret and paste them into the plugin section.

Screenshot 2024-02-14 at 6.12.53 PM.png

  • The Social Login button will be visible on the login page of your website above the Remember Me button.

Screenshot 2024-02-15 103229.png

  • If you want to show a social login button on any custom theme page, use Shortcode [webtonative_social_login] to display the social login button on that page.

Screenshot 2024-02-15 103355.png

  • By default WordPress will logout the user once the tab is closed. If you want to retain the user logged-in status even after the tab is closed on the webtonative social login configuration page enable remember me checkbox.

Screenshot 2024-02-15 103521.png

  • By default on successful login user will be redirected to the root path of the page i.e. https://your-custom-domain.com/ if you want to modify the redirect domain update the redirect URI in webtonative social login configuration

Screenshot 2024-02-15 103624.png

Frequently Asked Questions (FAQ)

Q. Why should I integrate Google login into my WordPress website?

A Google login has a number of advantages such as better user experience, more people will register, less friction in the registration process, and the Google authentication process adds greater security.

  • The users are able to log in fast without having to key in passwords. It increases sign ups and user interaction with ease in the process of registtartion.
  • With Google login, users authenticate their identity with few clicks beneficial in streamlining the process.
  • Google’s OAuth ensures strong protection against fraud helps in reducing unauthorised access and safeguarding user data.

Q. Is it required to develop an OAuth client ID to integrate to Google login?

AYes, you will need to create an OAuth client ID, which will enable your WordPress site to make authenticated communications with the authentication servers of Google and authenticate users.

  • Your site receives a unique identifier in the course of the OAuth flow which is the Secure User Authentication.
  • It allows your website permission to interact with Google services on behalf of the users.

Q. Can I customise where the social login button appears on my WordPress website?

A Yes, you can customise the placement of the social login button. By default, it appears above the "Remember Me" button on the WordPress login page. You can also use shortcodes to display it on custom theme pages.


Q. What will occur once the user closes the tab after having logged in with the Google login?

A When the tab or the browser window is closed, wordpress will automatically log out the user. However, you can: Enable Remember me option: This feature will make a user remain logged in even when they close their browser implying that they have a sticky user experience.


Q. Is it possible to redirect users to a particular page once they have successfully logged in with Google login?

A Yes, you may control fully where to which users are forwarded once they have logged in:

  • Custom Redirect URL: After authentication, the user may be redirected to custom URL, such as a welcome page, dashboard or the page they had visited previously.
  • Default Redirect: The default redirection will occur in the event of the absence of specific redirection to some specific page in your site.

Q. Does it have security issues with the integration of Google login in WordPress?

A Yes, there is security at all times. Some best practices include:

  • Use HTTPS: Your site should be delivered on HTTPS so that the communication between your site and the users will be encrypted.
  • Maintain Software Patches: It is advisable to keep your WordPress themes, plugins and other dependencies updated on a regular basis in order to address security vulnerabilities.
  • Keep API Keys safe: OAuth client keys can be stored safely, and they should not be published in open source code hosts or browser history.

Q. Am I able to add other forms of social logins other than Google login?

A Yes, there are many other social logins integrations:

  • Popular Alternatives: You can also integrate with Google and use in addition to logging in with Facebook, twitter, LinkedIn, Instagram, and GitHub, among others.
  • Flexibility: WordPress offers a wide array of socially-oriented logins that can be served by numerous options among the plugins, thus, allowing you to cover a wider spectrum of audience.

Q. What do I do to troubleshoot problems with the integration of Google login into my WordPress site?

A Trying the following, in case you are having problems:

  • Check Configuration: You should ensure that the OAuth credentials and the settings of the plugin are correctly configured.
  • Documentation: Majority of the social logins have detailed documentation to help you with the most common issue.
  • Plugin Support: Should any issue arise, go to the support forum or community of the specific plugin to seek troubleshooting tips or request assistance of the support team.
  • Clear Caches: Cache data can at times disrupt the process of logging in and therefore, clear your browser cache and clear your web site cache.

Q. Is there a limit to the number of users who can log in using Google login on my WordPress website?

A No, there is no hard restriction in how many users can log in using Google login. However:

  • Server Load: Are you going to have a lot of traffic? Check that your hosting plan is able to handle the volume of traffic as well as the authentication requests.
  • API Rate Limits: Google has API rate limits that are very liberal in real-world applications.

Q. Can I track user logins and activities after integrating Google login into my WordPress website? A Yes, and it is possible to trace user login activities using the appropriate plugins:

  • User Activity Monitoring: Most social login services have the option to show who is using it, including where the user has signed in (e.g. Google login) and when as well as other interactions.
  • Detailed Analytics: You can also install additional tracking software e.g. Google Analytics or other user behavior specific plugs in order to get a more detailed insight into user activity or their login rates.

Similar Blogs