Two-Factor Authentication

Starting from version 6.0, we added Two-Factor Authentication to enhance account security.

There are two ways to enable this feature:

  • System admin can tick the check-box at the “Password” section of the system settings page, or

  • just add ENABLE_TWO_FACTOR_AUTH = True to seahub_settings.py and restart service.

After that, there will be a “Two-Factor Authentication” section in the user profile page.

Users can use the Google Authenticator app on their smart-phone to scan the QR code.

Twilio intergration

We also support text message methods by using the Twilio service.

First you need to install the Twilio python library by

  1. sudo pip install twilio

After that, append the following lines to seahub_settings.py,

  1. TWO_FACTOR_SMS_GATEWAY = 'seahub_extra.two_factor.gateways.twilio.gateway.Twilio'
  2. TWILIO_ACCOUNT_SID = '<your-account-sid>'
  3. TWILIO_AUTH_TOKEN = '<your-auth-token>'
  4. TWILIO_CALLER_ID = '<your-caller-id>'
  5. EXTRA_MIDDLEWARE_CLASSES = (
  6. 'seahub_extra.two_factor.gateways.twilio.middleware.ThreadLocals',
  7. )

Note: if you have already defined EXTRA_MIDDLEWARE_CLASSES, please replace EXTRA_MIDDLEWARE_CLASSES = ( with EXTRA_MIDDLEWARE_CLASSES += (

After restarting, there will be a “text message” method when users enable Two-Factor Authentication for their account.