Giter VIP home page Giter VIP logo

collective.smsauthenticator's Introduction

collective.smsauthenticator

Two-step verification for Plone 4 with use login codes sent by SMS. This app allows users to enable the two-step verification for their Plone accounts. A mobile phone capable to receive SMS messages is obviously required. Usage of two-step verification is optonal, unless site admins have forced it (configurable in app control panel). Admins can white-list the IPs, for which the two-step verification would be skipped.

Prerequiresites

  • Mobile phone which is able to receive SMS messages.
  • Plone 4 (tested with Plone >= 4.3.1)

Limitations

Note, that two-step verification works only for Plone users and does not work for Zope users (those added with "./bin/instance" adduser command).

Usage

Case 1: Enabling the two-step verification

Pre-conditions: User is not logged into the Plone site, does not yet have two-step verification enabled and has a mobile phone.

From any page follow the "Enable two-step verification" link in the menu (next to "Log out").

_static/01_menu_enable.png

If you haven't yet filled in your mobile phone number, you will be requested to do so. You will receive immeditely a SMS with confirmation code in.

_static/02_setup_mobile_number.png

When you're done, you get to a page on which you will be requested to enter the code received by SMS.

_static/03_confirm_mobile_number_and_complete_two_step_verification_setup.png

Enter the secret code shown in the "Enter the verification code to activate two-step verification" field for confirmation and press the "Verify" button.

Upon successful confirmation (you should see a message stating that) the two-step verification is enabled for your account.

_static/04_enable_two_step_verification_confirmation_message.png

Case 2: Two-step verification

Pre-conditions: User is not logged in and has enabled the two-step verification.

When you log into the Plone site (just using username and password), you would see an extra screen on which you are asked to provide the login code, sent to your by SMS.

_static/05_login_code_form.png

You should then check your phone for the new SMS message and type in the token shown into the "Enter code" field.

If token is valid, you would be logged in.

Case 3: Lost mobile phone or phone number

Pre-conditions: User is not logged in, has enabled the two-step verification.

There might be cases when you have lost your mobile phone (either really lost it or broken accident or somehow lost ownership of your former mobile number). For such cases, you can reset the phone number.

Log into the Plone site (just using username and password), for to see the extra screen on which you are asked to provide the login code, sent to your by SMS and follow the link (help text of the "Enter code" field). You would then land on the page where from you can request the mobile number reset.

Enter your username and mobile number in the "Username" and "Mobile number" fields respectively, press the "Submit" button. Link for resetting your mobile number will appear in your mailbox shortly. Having clicked on the link to reset the mobile number, would bring your to a page where you can enter the verification code.

_static/06_request_to_reset_mobile_number.png

You will receive an SMS with verification code shortly. Enter the code in the "Enter the verification code to activate the two-step verification" field.

_static/07_confirm_mobile_number_reset.png

Upon successful confirmation (you should see a message stating that) your mobile number is reset.

_static/08_mobile_number_reset_confirmation_message.png

Case 4: Disabling the two-step verification

Pre-conditions: User is logged in and has enabled the two-step verification.

From any page follow the "Disable two-step verification" link in the menu (next to "Log out").

_static/09_menu_disable.png

After which you would get a message.

_static/10_disable_two_step_verification_confirmation_message.png

Installation

Buildout

>>> [instance]
>>> eggs +=
>>>     collective.smsauthenticator
>>> zcml +=
>>>     collective.smsauthenticator

ZMI

ZMI -> portal_quickinstaller

Choose "SMS Authenticator Plone" and install it.

ZMI -> acl_users

  1. Choose "sms_auth (SMS Authenticator plugin (collective.smsauthenticator))".

  2. Make sure the "Active plugins" section of "Authentication" has the following plugins in the given order ("sms_auth" should come as first - critical!):

    • sms_auth
    • session
    • source_users

Configuration options

App control panel can be accessed at http://your-plone-site.com/@@sms-authenticator-settings

Main

_static/11_control_panel_tab_main.png

Globally enabled

If checked, two-step verification is globally force-enabled for all site users and they no longer have an option to disable it; this applies to all new users (just registered accounts) as well.

White-listed IP addresses

List of white-listed IP addresses - one at a line. If user comes from one of those, the two-step verification is skipped even if user has enabled it or two-step verification is globally enabled.

Extra

Additionals options of the control panel are:

  • Enable two-step verification for all users.
  • Disable two-step verification for all users.

Twilio

_static/12_control_panel_tab_twilio.png

Twilio number

Your Twilio AccountSID and AuthToken. Visit your Twilio Account Phone Number page and check the Manage Numbers section.

Twilio AccountSID and Twilio AuthToken

Your Twilio AccountSID and AuthToken. Visit your Twilio Account Settings page and check the API Credentials section.

Security

_static/13_control_panel_tab_security.png

Secret Key

Site secret key - can be any string. See it as some sort of a password.

Token lifetime

Lifetime of the login- and the mobile number reset- codes. Defaults to 5 minutes (300 seconds).

Notes

It's important that SMS Authenticator comes as first in the ZMI -> acl_users -> Authentication.

Tested in combination with the following products:

Documentation

See the documentation at:

Support

For feature requests or bugs, open an issue. For questions, send us an email to [email protected].

License

GPL 2.0

Authors & Copyright

Copyright (C) 2014 Goldmund, Wyldebeast & Wunderliebe.

Authors are listed in alphabetic order (by name):

  • Artur Barseghyan [barseghyanartur]
  • Harald Friessnegger[frisi]
  • Jan Murre [JJM]
  • Rene Jochum [pcdummy]
  • Peter Uittenbroek [puittenbroek]

TODOs and Roadmap

See TODOS.rst file for the list of TODOs.

collective.smsauthenticator's People

Contributors

barseghyanartur avatar frisi avatar gforcada avatar jjmurre avatar jochumdev avatar puittenbroek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

collective.smsauthenticator's Issues

Firefox 30 problems

All steps via firefox steem to work, but somehow the cookie seems lost.
Clicking anywhere you need to be logged in for, result in a new login form.

globally activated sms auth not set for new users

currently sms authentication is not activated for new users.

to reproduce:

  • log in as site-admin
  • install smsauthenticator
  • enable "globally enabled" in @@sms-authenticator-settings
  • create a new user (check send email to set password)
  • optional: set a mobile number for this user
  • open different browser
  • open link and set password for newly created user
  • login with new password

currently the user will be successfully logged in

what should happen is:
A) if a mobile number has been set: the user should be prompted for the code he/she received on their mobile phone or
B) (if no mobile number has been set) the user should be asked to set and verify his/her mobile number

the problem is, that for new users the checkbox enable_two_step_verification in /@@user-information?userid=newuser is not checked.

suggested solution:
register event listener for user added event and set enable_two_step_verification if globally_enabled == True

Managers can't set other user's phone number

seems that site-admins can't set the phone number of existing users.

is this a use-case that is supposed to work?:

  • login as site-admin
  • activate sms auth globally in @@sms-authenticator-settings
    and activate it for all existing users (@@sms-authenticator-enable-for-all-users)
  • visit https://myhost.com/@@usergroup-userprefs
  • create user account (eg. tester)
  • edit personal prefs of tester (@@user-information?userid=tester)
  • supply mobile number (leave other fields with defaults - see screenshot)

smsauth

  • submit the form

what i get is a status message that tells me that the personal preferences have successfully been saved.
but the field for the mobile number is still empty.

User + IP log for white list

It would be a nice enhancement to have a log somewhere to see which user came from which ip adress. To make it easier for site managers to add IP adressen to the whitelist.

Make smsauthenticator work with overlays

currently you'll need to deactivate popupforms.js (or at least overlays for the login process) on plone 4.x to make sure users see the status messages.

otherwhise users will

  • click on login
  • type username and password in the overlay and press login
  • overlay will close
  • the user will be redirected to the page the clicked on the "login" action without beeing logged in

instead of this we should show the @@sms-authenticator-token in the status page, or at least rediret the user there

we had similar problem with collective.pwexpiry. maybe this helps fix this collective/collective.pwexpiry#10

in the meantime the readme should contain a warning that popupforms.js should be disabled when using collective.smsauthenticator.

Twilio SMS not always arriving

Recently we have noticed that SMSs are not always arriving. Sometimes it takes 2 or several more "resends" to receive the SMS. There does not seem to be a pattern.

Also interesting: the log sometimes shows immediately after the Twilio messages are sent that the user has successfully logged in, but, in fact, the user has not even received the SMS with the auth code.

I see that this create() call does not check a return status:

https://github.com/collective/collective.smsauthenticator/blob/master/src/collective/smsauthenticator/helpers.py#L538

In the Twilio docs it looks like webhooks can be used to be notified of delivery status. Is there no other way to know if a message was successfully delivered?

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.