Skip to content

WPManageNinja/fluent-auth-client

Repository files navigation

FluentAuth Client

Connect child site with your parent site for Authentication


Description

The aim of this WordPress plugin is to provide a seamless authentication experience for users across multiple WordPress sites. By connecting child sites with a parent site, users can log in via your parent site's authentication system, allowing for a single sign-on experience. This is particularly useful for organizations or businesses that manage multiple WordPress sites and want to streamline user access.

Features

  • Single Sign-On (SSO): Users can log in once on the parent site and gain access to all connected child sites without needing to log in again.
  • User Sync: Synchronize user accounts from the parent to child sites, ensuring that user data is consistent across all sites. Please note, the data is not synced back to the parent site and when a user is login to your child site, then the user data is synced to the child site.
  • Customizable Settings: Administrators can configure the plugin settings to suit their needs, including enabling/disabling SSO and user sync features.

Installation

  • Download this plugin from this GitHub releases page and then install & active on your Child Site.
  • Go to Settings -> FluentAuth Connect and then copy the child site config code.

On your Parent Site

  • Install & active the FluentAuth plugin on your Parent Site.
  • Add the following code to your Parent Site's wp-config.php file:
define('FLUENT_AUTH_SERVER_MODE', true);
  • Go to the FluentAuth settings page on your Parent Site and then navigate to "Remote Auth" -> Click Add new.
  • Paste the child site config code that you copied from the Child Site and then click on "Save" button.
  • Now you will get a token code for your Parent Site. Copy that and paste that token code to your Child Site's FluentAuth Connect settings page and then click on "Save" button.
  • Now you will see the Child Site is connected with your Parent Site. You can also disconnect the Child Site from your Parent Site by clicking on the "Disconnect" button.

How it works

When a user attempts to log in to a child site, This plugin redirects to the parent site for authentication. If the user already logged in to your parent site, it will redirect back to the child site with a valid secure token. Once the token is verified by the child site, the child site send REST request to the parent site to get the user data. The child site then creates a new user account or updates the existing one based on the data received from the parent site. Then this plugin logs the user in to the child site and redirect the user to the appropriate page.

Development

To contribute to this plugin, you can clone the repository and make changes as needed. Please ensure that you follow the coding standards and best practices for WordPress development. Once you have made your changes, you can submit a pull request for review.

This plugin UI is built with VueJS 3. To compile the assets, you will need to have Node.js and npm installed on your machine. Once you have those installed, you can run the following commands in the root directory of the plugin:

# Install dependencies
npm install
# Compile assets (development)
npx mix watch
# Compile assets (production)
npx mix --production

Support

This is an open-source project, and we welcome contributions from the community. If you encounter any issues or have suggestions for improvements, please open an issue on our GitHub repository.

About

Connect child site with a parent site for Authentication - WP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published