Giter Club home page Giter Club logo

authpress's Introduction

Authenticator for WordPress

Scrutinizer Code Quality

If you are concerned about security, you should look into 2-factor authentication.

Quick reminder: 2-factor authentication adds an extra layer of security by requesting a one time password in addition to standard username / password credentials.

Download the Google Authenticator app on your phone (iPhone, Android or Blackberry). Install this plugin on your site. After activating it and generating a secret key, you will be able to add the site to your app by scanning a QR code. That's it!

The QR code is generated with Google Charts API using HTTPS to avoid security issues while sending your secret for generation.

What the plugin does:

  • Adds 2-factor authentication to WordPress login page,
  • Can be eanbled for each user independantly,
  • Admin can force users to use 2FA (and limit the number of allowed logins without setting up 2FA). The use of 2FA can be forced for all users or for specific roles,
  • Support applications passwords (with access log),
  • If admin forces users to use 2FA, users who didn't set it up will be reminded with a warning in their dashboard,
  • Set any name you want to appear in the Google Authenticator app,
  • Allow clock discrepancy (mins +/-),
  • Users can generate a new secret key anytime,
  • Admin can revoke any user's key at anytime,
  • If a user is locked-out after logging-in too many times without using 2FA, admin can reset the counter,
  • Used one time passwords are hashed and stored in the DB to avoid multiple use (in case of interception by an attacker)
  • Recovery code in case the user can't use the app

Using Authy

You're using Authy? Authenticator for WordPress is fully compatible with Authy. You can add the 2-steps authentication and use Authy to generate the one time password.

Changelog

1.1.1

  • Fix an issue with the settings page not showing up
  • Contextual help deprecated bug
  • Remove mentions of Google in the plugin name chore

1.1.0

  • Add support for apps passwords
  • Admins can now force 2FA by user role
  • Add Finnish translation (props Makke375)
  • Improve performance by reducing plugin footprint
  • Fix the bug that allowed users to login 1 more time after they reached the limit when they don't have 2FA setup yet

1.0.7

  • Add cron task to clean TOTPs from DB

1.0.6

  • Fix issue with spaces in site name (jeremyawhite)

1.0.5

  • Add issuer in the Google Authenticator account

1.0.4

  • Add recovery code feature
  • Update translations

1.0.3

  • Add support for WordPress Android / iPhone app
  • Add French translation

1.0.2

  • Update version number
  • Remove double confirmation message after saving options
  • Update option label and disable TOTP if plugin is not set to Active

1.0.1

  • Only push the trunk

1.0.0

  • First release of the plugin

authpress's People

Contributors

andrewcarreiro avatar jbrinley avatar jeremyawhite avatar julien731 avatar rob-mosher avatar siamkreative avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

authpress's Issues

Refactor App Passwords

For reasons that are stated in #29 the app passwords component needs a refactoring. What seems to be the best solution is the creation of a custom database table.

This would have multiple advantages:

  • easy to store app passwords and backup codes in the same table
  • super simple to lookup an app password
  • no messy array to play with to invalidate a code
  • no weird process to make sure that a key of a hash is unique (yeah it sounds weird)

The custom table should be something like this:

ID |user_id | key | type | count

If we go that way, though, it would make sense that the access log has its own custom table as well. The current access log has the following information:

  • key (the app password hash key. Yeah, the weird thing)
  • last_used
  • ip
  • user_agent
  • method

It goes without saying that an upgrade routine will be necessary...

2FA not Enforced if a User has an Additional Capability and wpga_active not Set

Hey,

I want to report a corner case. We have enforced 2FA for a select list of roles. But the user is able to log in without 2FA if,

  1. The user has a capability directly assign to him in addition to a normal role like this a:2:{s:14:"capability_new";b:1;s:10:"subscriber";b:1;},
  2. And wpga_active meta key is not set. We have a lot of cases where the 2FA is active but wpga_active is not set
  3. And the capability comes before the role.

Thanks
Asif

Show which users have 2FA setup

We just enabled 2FA on a clients site. There are 10 administrator role users in addition to the client. He's set things to require 2FA for all administrators.

Only 3-4 got their 2FA setup before forcing use.

It'd be good to see which users have 2FA setup without having to click through to each user. Perhaps adding a column to /wp-admin/users.php with a icon or something to indicate they've setup 2FA?

Also, I didn't see documentation on this, but in our scenario I'm assuming those users without 2FA setup now can't login, correct? I think they should be allowed to login and then forced to setup 2FA upon login, but I don't think it works that way currently. Either way, it'd be userful to update the FAQ to explain thing for that scenario. (a few admins have 2FA setup, 2FA is forced, what happens with other admins)

Refactor User Interface

Following all the latest changes, I believe it is time for a UI overhaul in order to improve the user experience.

By developing the plugin with many other plugins enabled (like e-commerce plugins), I realize that the important security settings that Authenticator adds are hard to find. Also, in addition to #28 and #26 having a brand new user dashboard dedicated to security would be a nice improvement.

Add Providers Interface

At the moment the plugin only provides OTP using Google Authenticator. Because it would be cool to have other providers (YubiKey) and because I'd like to play with new APIs and systems, adding a providers management interface could be the next step.

Also, this would come in very handy for #21

Introduce 2FA User Class

There are quite a few things happening for a user that has 2FA enabled. At the moment, the code is mostly procedural, which works well, but having a user object could make things easier. It would also give a clearer overview of the user meta data and make it easier to retrieve pieces of information.

Apps Passwords

As suggested in a thread on WP.org, an app password feature could be useful, especially for use with blog editing softwares such as Blogsy or Microsoft Writer.

App passwords should be created on a per user basis and appear in the user profile page. Passwords should be easily revokable and in order to ensure security a minimum of logging should be done on app passwords (last used and from where).

Add link to Settings on Plugins Page

Add a direct link to the Settings page + Eventually add a WordPress notification "Google Authenticator is not configured. Click here to set it up"

[RFE] Force users to generate TOTP instead of locking them out

Right now, if a user ignores the 2FA requirement until the login timeout is reached, they are locked out entirely and unable to log in.

Instead, if they log in successfully, they should instead be told that they MUST generate a code to log-in. This would probably require some sort of check that forces them to a generation page on every action, to make sure they didn't "deep-link" to somewhere in the admin interface to get around the login check (as they'd technically be logged-in correctly).

Secret key can't be copied

The secret key used to generate the QR code can't easily be copied to be saved in a secure location. Change the input disable.

multi-site support

Is there any support for multi-site Wordpress installs? After installing the plugin I got no options to configure any settings.

Rebrand Plugin

Because one of my goals is to add more providers, the name "WP Google Authenticator" won't be very accurate anymore. Actually, it is already not very accurate: I am using Authy to manage my TOTPs, and not GA.

Related to #22

Unable to login across multisite blogs

So, after enabling this plugin network-wide on a multisite installation, I ran into several issues.

The first was that the TOTP field wasn't being added to the login page. From what I could tell, this was because wpga_options hadn't been propagated to the child blogs. This resulted in a request to please fill in my TOTP even though it was impossible to do so.

I was able to correct this by copying over the serialized data from the main blog to each of the options tables for the children blogs.

However! While this solved the problem of the login page not appearing on the child blogs, this did not solve the problem of being told I need to provide my TOTP on every login. :(

I wonder if the issue is that I have a TOTP on the main blog, but it isn't propagated to the child blogs either?

Update Textdomain

Update textdomain to enable WordPress.org localization system (GlotPress). See #26 for prerequisites.

Force 2FA by User Role

Allow admins to force the use of 2FA for specific roles only (and not all users without distinction as it is now).

A checkbox list would let the admin check the roles that needs to use 2FA. This could be useful in order to enforce security for users with advanced permissions and not bother users with little permissions.

Improve User Activation Workflow

The current activation workflow is based on one principle that might have to be revised.

At the moment, 2FA activation and secret key generation are two different actions. This is to allow the user to deactivate 2FA without having to reset his secret key (hence no need to update the site in the TOTP app).

However, this makes the activation more complex for what I believe is a small benefit (if really it is a benefit).

With #17 it makes even less sense as the secret key will probably be removed from the user edit screen.

UX Issue

The current workflow also introduces what I think is a major UX problem. If the user enables 2FA but, for some reason, forgets to add the site to his TOTP app, there is no warning of any kind. The user can very easily end up being locked out of the site because (s)he doesn't have the TOTP.

For complete TOTP activation, the user should be asked to input his TOTP (like it is done in many web apps).

Proposed Workflow

Display only the activate button. Once clicked, the secret key is generated and saved via Ajax. The QR code is then immediately displayed and the user is prompted to input his TOTP.

The secret will be saved in a "temporary" meta (for instance wpga_secret_tmp). The QR code and TOTP prompt will always be displayed when this meta is present. Only when the user enters his TOTP, the temporary meta is deleted and the secret is saved in the final meta entry. This will avoid changing the parts where the secret is accessed.

Remember Users

Following a feature request on Facebook, it could be a good idea to check for the cookie before asking for TOTP.

The TOTP check is hooked on wp_authenticate_user (through wp_authenticate_username_password ) which has priority 20, while wp_authenticate_cookie, on the same hook, has priority 30. This means that an error is returned because of the TOTP before the cookie is check.

An easy solution would be to manually check for wp_authenticate_cookie within our auth function.

Add E-Mail Fallback

Some users have been in a situation where they were unable to get the OTP from their phone or there was a time sync issue preventing them to login using the OTP.

For those reasons it would be a good idea to have a fallback where an OTP could be sent by e-mail upon user request. The OTP would obviously have a longer lifetime.

The questions that remains though are:

  • Should this be enabled by default (I believe it should)
  • Should admins be able to toggle this on and off
    • How should this be toggled? Option? Constant?

Better Protect Secret Key

The secret key should not be displayed in clear text (security reasons). Instead, it should be retrieved by either:

  • Asking the user to re-enter his password and ask for confirmation that the current network is safe
  • Sending an e-mail to the user

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.