Skip to content

loginid1/loginid-wordpress-plugin

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

LoginID DirectWeb

For WordPress

Report Bug · Request Feature

Table of Contents

About The Project

WordPress Plugin to enable a passwordless login experience using LoginID's Direct Web API.

This plugin will add two custom short codes [loginid_login] and [loginid_registration]. These two short codes will generate a login form and a register form that will use LoginID's DirectWeb API to authenticate the user without a password.

The user must have a FIDO2 compatible device, otherwise this form will default back to using a password authentication instead.

This plugin is compatible with WordPress' default password login, so this should be compatible with existing authentication plugins.

Getting Started

Prerequisites

As this is a wordpress plugin this project requires wordpress to run.

(OPTIONAL) If you wish to modify the Javascript source files and/or PHP dependancies within this project, then you would also need to nave Node, NPM, and Composer installed.

WordPress Setup Guide

  1. Install the plugin (through the zip file or through the wordpress plugin store)

  2. Configure the plugin under Settings > LoginID DirectWeb (as shown in the image below)

    Settings

  3. Choose one of the following methods of obtaining your Base URL and Client Id from LoginID. You can either

    • Run the setup Wizard by clicking on the Run Setup Wizard button. An expanded menu will be displayed to disclose exactly what this wizard does. It sends some of your site information directly to LoginID so the create integration form will be pre-populated with data, and presents you with the option to directly save the BaseURL and Client Id directly to your wordpress site. (You can always perform this action manually).

Setup Wizard

  • Or Visit LoginID Dashboard on the integrations page, and manually input required site data. This method will collect less data, but requires you to manually copy and paste over the BaseURL and Client Id from LoginID.(shown in the following two screenshots).

Copy from the LoginID dashboard

LoginID Dashboard

To the plugin dashboard

Plugin Dashboard

  1. Add [loginid_login] and [loginid_registration] to your login and register pages for the form to be displayed. (Note that the forms will not be shown when the user is logged in.)

Building From Source

  1. Go to your wordpress plugin folder
cd htdocs/wp-contents/plugins
  1. Download or clone this repo
git clone https://github.com/loginid1/loginid-wordpress-plugin.git
  1. Install php dependencies
composer install
  1. Open up wordpress and configure the plugin (refer to above)
  2. (Optional) Editing javascript. Edit stuff in srcjs and don't edit javascript in includes (its minified and generated from files in srcjs anyway). You'll need nodejs to run though.
  3. (Optional) Build your own javascript files
npm i
npm run dev

Roadmap

See the open issues for a list of proposed features (and known issues).

License

Distributed under the GPLv3 License. See LICENSE for more information.

Contact

LoginID - dev@loginid.io

If you need plugin help feel free to contact jimmy@loginid.io (usually reply within 48 hours).

Project Link: https://github.com/loginid1/loginid-wordpress-plugin

Acknowledgements

Footnotes

  • The plugin was originally interanlly named loginid-directweb-plugin-for-wordpress. (loginid_dwp)
  • Wordpress itself doesn't allow plugin names to contain "plugin" or "wordpress" as it is redundant for listing on the plugin repository.
  • This plugin was thus renamed to loginid-directweb (loginid_dw)
  • Due to naming confusing the repo name changed back to loginid-wordpress-plugin.
  • The plugin's internal prefix in code will remain logini_dw_*