All Projects → rtCamp → login-with-google

rtCamp / login-with-google

Licence: GPL-2.0 license
Minimal plugin which allows WordPress user to login with google.

Programming Languages

PHP
23972 projects - #3 most used programming language
typescript
32286 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects

Projects that are alternatives of or similar to login-with-google

USTC-CS-Resources
USTC计算机学院 个人学习资料分享
Stars: ✭ 86 (+152.94%)
Mutual labels:  labs
bring-your-own-data-labs
Bring your own data Labs: Build a serverless data pipeline based on your own data
Stars: ✭ 40 (+17.65%)
Mutual labels:  labs
labs-migration-viz
A single-page interactive visualization of historic U.S. Census migration data for New York City
Stars: ✭ 18 (-47.06%)
Mutual labels:  labs
iot-curriculum
Hands on labs and content for students and educators to learn and teach the Internet of Things at schools, universities, coding clubs, community colleges and bootcamps
Stars: ✭ 110 (+223.53%)
Mutual labels:  labs
Container.training
Slides and code samples for training, tutorials, and workshops about Docker, containers, and Kubernetes.
Stars: ✭ 2,377 (+6891.18%)
Mutual labels:  labs
advanced-istio-service-mesh-workshop
Advanced Istio Service Mesh Workshop
Stars: ✭ 28 (-17.65%)
Mutual labels:  labs
CSUS-CPE-CSC-EEE-Materials
Homework, labs, tests for a variety of classes. Feel free to share. California State University, Sacramento
Stars: ✭ 38 (+11.76%)
Mutual labels:  labs
APT-Lab-Terraform
Purple Teaming Attack & Hunt Lab - Terraform
Stars: ✭ 144 (+323.53%)
Mutual labels:  labs
DZ-Pharma-Data
Medications data for +4800 drugs sold in Algeria and their labs
Stars: ✭ 23 (-32.35%)
Mutual labels:  labs
database labs
initial set of databases labs
Stars: ✭ 19 (-44.12%)
Mutual labels:  labs
labs-zap-search
Search application for the DCP Zoning Application Search
Stars: ✭ 13 (-61.76%)
Mutual labels:  labs
Academiccontent
Free tech resources for faculty, students, researchers, life-long learners, and academic community builders for use in tech based courses, workshops, and hackathons.
Stars: ✭ 2,196 (+6358.82%)
Mutual labels:  labs
awesome-mobile-robotics
Useful links of different content related to AI, Computer Vision, and Robotics.
Stars: ✭ 243 (+614.71%)
Mutual labels:  labs
SI4844
Silicon Labs SI4844 (BROADCAST ANALOG TUNING DIGITAL DISPLAY AM/FM/SW RADIO RECEIVER) Library
Stars: ✭ 16 (-52.94%)
Mutual labels:  labs
robo-chart-web
📊 Transform Google sheets to pretty charts!
Stars: ✭ 28 (-17.65%)
Mutual labels:  labs
LAB
MIT IT Lab Repository
Stars: ✭ 23 (-32.35%)
Mutual labels:  labs
Labtainers
Labtainers: A Docker-based cyber lab framework
Stars: ✭ 226 (+564.71%)
Mutual labels:  labs
computer-networks
computer networks on docker @ fmi.unibuc.ro
Stars: ✭ 72 (+111.76%)
Mutual labels:  labs
labs-maputnik-dev-server
An express.js server that allows for quickly loading mapboxGL styles from any project into the Maputnik Style Editor
Stars: ✭ 31 (-8.82%)
Mutual labels:  labs
hackthebox
Notes Taken for HTB Machines & InfoSec Community.
Stars: ✭ 286 (+741.18%)
Mutual labels:  labs

Login with Google

WordPress plugin to login/register with google

  1. Overview

  2. Installation

  3. Usage Instructions

    Plugin Constants Hooks

  4. Shortcode

  5. Minimum Requirements

  6. License

Overview

Login with google provides seamless experience for users to login in to WordPress sites using their google account. No need to manually create accounts, no need to remember quirky passwords. Just one click and land into the site!

Installation

  1. Clone this repository.
  2. Run composer install --no-dev from inside the cloned directory.
  3. Upload the directory to wp-content/plugins directory.
  4. Activate the plugin from WordPress dashboard.

Browser support

These browsers are supported. Note, for example, that One Tap Login is not supported in Safari.

Usage Instructions

  1. You will need to register a new application at https://console.cloud.google.com/apis/dashboard

  2. Authorization callback URL should be like https://yourdomain.com/wp-login.php, where https://yourdomain.com will be replaced by your site URL.

  3. Once you create the app, you will receive the Client ID and Client Secret, add these credentials in Settings > Login with google settings page in their respective fields.

  4. Create new user enables new user registration irrespective of Membership settings in Settings > General; as sometimes enabling user registration can lead to lots of spam users. Plugin will take this setting as first priority and membership setting as second priority, so if any one of them is enabled, new users will be registered by this plugin after successful authorization.

  5. Whitelisted Domains allows users from specific domains (domain in email) to get registered on site. This will prevent unwanted registration on website. For Example: If you want users only from your organization (myorg.com) to get registered on the website, you enter myorg.com in whitelisted domains. Users with google email like [email protected] will be able to register on website. Contrary to this, users with emails like [email protected] would not be able to register here.

Plugin Constants

Above mentioned settings can also be configured via PHP constants by defining them in wp-config.php file.

Refer following list of constants.

Type Description
WP_GOOGLE_LOGIN_CLIENT_ID String Google client ID of your application.
WP_GOOGLE_LOGIN_SECRET String Secret key of your application
WP_GOOGLE_LOGIN_USER_REGISTRATION Boolean (Optional) Set True If you want to enable new user registration. By default, user registration defers to Settings > General Settings > Membership if constant is not set.
WP_GOOGLE_LOGIN_WHITELIST_DOMAINS String (Optional) Domain name, if you want to restrict login with your custom domain. By default, It will allow all domains. You can whitelist multiple domains.

These constants can also be configured via wp-cli.

Note: If you have defined the constant in wp-config.php file, corresponding settings field will be disable (locked for editing) on the settings page.

Hooks

Filters

Filter Description Parameters
rtcamp.google_scope This filter can be used to filter existing scope used in Google Sign in.
You can ask for additional permission while user logs in.
  • scope - contains array of scopes.
rtcamp.google_login_modules Filter out active modules before modules are initialized.
  • active_modules - contains array of active modules.
rtcamp.google_login_button_display This filter is useful where we want to forcefully display login button, even when user is already logged-in in system.
  • display - contains a boolean value of whether to display the button or not.
rtcamp.google_default_redirect Filter the default redirect URL in case redirect_to param is not available.
Default to admin URL.
  • admin_url - contains the admin URL address which is used as redirect URL by default.
rtcamp.google_register_user Check if we need to register the user.
  • user - contains the user object from google.
rtcamp.google_client_args Filter the arguments for sending in query.
This is useful in cases for example: choosing the correct prompt.
  • client_args - contains the list of query arguments to send to Google OAuth.
rtcamp.google_login_state Filters the state to pass to the Google API.
  • state_data - contains the default state data.
rtcamp.default_algorithm Filters default algorithm for openssl signature verification
  • default_algo - Default algorithm.
  • algo - Algorithm from JWT header.

Actions

Action Description Parameters
rtcamp.google_login_services Define any additional services.
  • container - Container object.
rtcamp.google_user_authenticated Fires once the user has been authenticated via Google OAuth.
  • user - User object.
rtcamp.id_token_verified Do something when token has been verified successfully.
If we are here that means ID token has been verified.
rtcamp.google_user_logged_in Fires once the user has been authenticated.
  • user_wp - WP User data object.
  • user - User data object returned by Google.
rtcamp.google_user_created Fires once the user has been registered successfully.
  • uid - User ID
  • user - WP user object.
rtcamp.login_with_google_exception Fires when an exception is raised during token verification.
  • exception - The exception which is being raised.

Shortcode

You can add the google login button to any page/post using shortcode: google_login

Example:

[google_login button_text="Google Login" force_display="yes" /]

Supported attributes for shortcode

Parameter Description Values Default
button_text Text to show for login button string Login with google
force_display Whether to display button when user is already logged in yes/no no
redirect_to URL where user should be redirected post login URL wp-admin

Contribute

Reporting a bug 🐞

Before creating a new issue, do browse through the existing issues for resolution or upcoming fixes.

If you still need to log an issue, making sure to include as much detail as you can, including clear steps to reproduce your issue if possible.

Creating a pull request

Want to contribute a new feature? Start a conversation by logging an issue.

Once you're ready to send a pull request, please run through the following checklist:

  1. Browse through the existing issues for anything related to what you want to work on. If you don't find any related issues, open a new one.

  2. Fork this repository.

  3. Create a branch from develop for each issue you'd like to address and commit your changes.

  4. Push the code changes from your local clone to your fork.

  5. Open a pull request and that's it! We'll with feedback as soon as possible (Isn't collaboration a great thing? 😌)

  6. Once your pull request has passed final code review and tests, it will be merged into develop and be in the pipeline for the next release. Props to you! 🎉

Unit testing

Unit tests can be run with simple command composer tests:unit. Please note that you'll need to do composer install (need to install dev dependencies) for running unit tests.

You should have PHP CLI > 7.1 installed. If you have Xdebug enabled with php, code coverage report will be generated at /tmp/report/html

Minimum Requirements

WordPress >= 5.5.0

PHP >= 7.4

License

This library is released under "GPL 2.0 or later" License.

BTW, We're Hiring!

Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].