2017 © Pedro Peláez
 

silverstripe-vendormodule bootstrapmfa

Enable authentication with fallback codes

image

firesphere/bootstrapmfa

Enable authentication with fallback codes

  • Thursday, May 24, 2018
  • by Firesphere
  • Repository
  • 1 Watchers
  • 1 Stars
  • 183 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

MultiFactor Boostrap for SilverStripe

Build Status Scrutinizer Code Quality codecov, (*1)

This module aims to help create an multi-factor authentication method for SilverStripe, by bootstrapping an unregistered authenticator with Backup tokens to have a basic start., (*2)

Current stage is a pretty basic implementation, but it should get you started pretty fast. For example of implementation, see https://github.com/Firesphere/silverstripe-yubiauth/tree/mfa-base, (*3)

Installation

composer require firesphere/bootstrapmfa, (*4)

Usage

First, after installation, create your MFA module. (or use an existing one that bolts on top of this one), (*5)

The module in itself does nothing but create the basic requirements for 2-factor token-based backup login. It does not provide active 2FA login methods., (*6)

Your Authenticator should extend BootstrapMFAAuthenticator In the validation method, if the intended MFA method fails, you can fall back on the parent::validate() method., (*7)

This is the Bootstrap Authenticator, that will let people login with one-time text-tokens., (*8)

Your second-factor form needs to be it's own form, but has to have a field named token, which can fall back via the Bootstrapper.., (*9)

This can be done on creation of the Member, via BootstrapMFAProvider::updateTokens($member), (*10)

Configuration


--- name: AppMFAAuthenticator --- Firesphere\BootstrapMFA\BackupCode: token_limit: 15 # Default amount of tokens Firesphere\BootstrapMFA\CodeGenerator: length: 6 # Length of the codes type: numeric # Type of the codes, numeric|mixed|characters case: mixed # Casing of the characters. upper|lower|mixed

In the CMS, a new set of tokens can be requested., (*11)

If a user resets its password, the login-screen will show the created new tokens (once), (*12)

Tokens are stored encrypted and can not be retrieved, only validated., (*13)

Extending

This module is meant to be extended and not work on it's own. It only supplies fallback codes, like other MultiFactor authentication sites do., (*14)

When building an MFA module on top of this, a few things are required: - Your MFALoginHandler extending BootstrapMFALoginHandler - Your MFAProvider implementing the MFAProvider - Your authenticator extending BootstrapMFAAuthenticator - Must call the validateBackupCode method to validate the MFA backup codes, (*15)

An example of how to use this can be found at firesphere/silverstripe-yubiauth, (*16)

A non-functional demo module is expected to be released soon~ish, (*17)

License

This module is published under BSD 3-clause license, although these are not in the actual classes, the license does apply:, (*18)

http://www.opensource.org/licenses/BSD-2-Clause, (*19)

Copyright (c) 2017-NOW(), Simon "Firesphere" Erkelens, (*20)

All rights reserved., (*21)

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:, (*22)

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution., (*23)

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE., (*24)

Did you read this entire readme? You rock!

Pictured below is a cow, just for you., (*25)


/( ,,,,, )\ _\,;;;;;;;,/_ .-"; ;;;;;;;;; ;"-. '.__/`_ / \ _`\__.' | (')| |(') | | .--' '--. | |/ o o \| | | / \ _..=.._ / \ /:. '._____.' \ ;::' / \ .; | _|_ _|_ ::| .-| '==o==' '|-. / | . / \ | \ | | ::| | | .| | ( ') (. )::| |: | |; U U ;|:: | `| |' | | \ U U / |' | | ##V| |_/`"""`\_| |V## ##V## ##V##

The Versions

24/05 2018

dev-master

9999999-dev

Enable authentication with fallback codes

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Simon `Firesphere` Erkelens

authentication security module silverstripe 2-factor

18/02 2018

1.0

1.0.0.0

Enable authentication with fallback codes

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Simon `Firesphere` Erkelens

authentication security module silverstripe 2-factor