Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two-factor authentication support #388

Merged
merged 23 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
67cc978
Basic support for TOTP-based twofactor authentication
doobry-systemli Jul 13, 2022
d58e426
Add custom template for two-factor authentication login form
doobry-systemli Jul 15, 2022
701057a
Add forms to enable and disable two-factor authentication
doobry-systemli Jul 15, 2022
14b7a0c
Enable CSRF protection for two-factor verification at login
doobry-systemli Jul 16, 2022
79bf952
Set issuer, server name and image for TOTP QR code
doobry-systemli Jul 16, 2022
1d6521f
Require confirmation with two-factor token before activating it
doobry-systemli Jul 16, 2022
62a05f5
Allow to disable two-factor authentication for users from admin inter…
doobry-systemli Jul 16, 2022
851c6ed
Clear two-factor authentication settings during recovery process
doobry-systemli Jul 16, 2022
df0ba6b
Apply code formatting style fixes by php-cs-fixer
doobry-systemli Jul 17, 2022
6cf3714
Unit tests for two-factor implementation
doobry-systemli Jul 17, 2022
40ecce1
Let `totpConfirmed` default to `false` in TwofactorTrait.
doobry-systemli Jul 17, 2022
f31d3d3
Add behat integration tests for twofactor authentication
doobry-systemli Jul 17, 2022
abdf053
Display alert about unset two-factor auth as warning, not as error
doobry-systemli Jul 17, 2022
9ea8e52
Make issuer, server_name and logo configurable for TOTP QR code
doobry-systemli Sep 11, 2022
17a12eb
Don't reset 2FA settings during password recovery process
doobry-systemli Sep 11, 2022
2530b20
Add support for twofactor backup codes
doobry-systemli Sep 11, 2022
8738416
Add behat integration tests for two-factor backup codes
doobry-systemli Sep 11, 2022
1f0fc8d
Clear user twofactor settings when resetting user via console command
doobry-systemli Oct 26, 2022
ad4bf26
Clear backup codes and totpConfirmed when resetting 2FA as admin
doobry-systemli Oct 26, 2022
53206b7
Add german translation for twofactor strings
doobry-systemli Oct 26, 2022
28ce32a
Add metrics about accounts with two-factor auth to munin stats
doobry-systemli Oct 26, 2022
5bb1177
Code style fixes by php-cs-fixer
doobry-systemli Oct 26, 2022
ded11c4
Remove superfluous comment lines from scheb_2fa config
doobry-systemli Oct 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@

APP_NAME="Userli"
APP_URL="https://users.example.org"
APP_DOMAIN="users.example.org"
PROJECT_NAME="example.org"
PROJECT_URL="https://www.example.org"
PROJECT_LOGO_URL="https://www.example.org/logo.png"
SENDER_ADDRESS="[email protected]"
NOTIFICATION_ADDRESS="[email protected]"
SEND_MAIL=1
Expand Down
10 changes: 10 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Upgrade documentation

## Upgrade from 3.0.0 or lower

The new twofactor authentication (2FA) feature requires the database schema to
be updated:

ALTER TABLE virtual_users
ADD totp_confirmed TINYINT(1) DEFAULT 0 NOT NULL,
ADD totp_secret VARCHAR(255) DEFAULT NULL;
ADD totp_backup_codes LONGTEXT NOT NULL;

## Upgrade from 2.6.1 or lower

The new OpenPGP WKD feature requires GnuPG (>=2.1.14) to be installed.
Expand Down
9 changes: 9 additions & 0 deletions assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ body {
margin-bottom: 10px;
}

.alert-header {
text-align: center;
}

.flash-notification {
position: absolute;
right: 10px;
Expand All @@ -96,3 +100,8 @@ body {
.ascii {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}

.twofactor-backup-codes {
white-space: pre-line;
padding-left: 15px;
}
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"nelmio/security-bundle": "^2.5",
"pear/crypt_gpg": "^1.6",
"ramsey/uuid": "^4.1",
"scheb/2fa-backup-code": "^5.13",
"scheb/2fa-bundle": "^5.13",
"scheb/2fa-qr-code": "^5.13",
"scheb/2fa-totp": "^5.13",
"sensio/framework-extra-bundle": "^5.0.0",
"sonata-project/admin-bundle": "3.75.0",
"sonata-project/doctrine-orm-admin-bundle": "^3.24",
Expand Down
Loading