Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit b44572c

Browse files
author
Billy Clark
committed
users with backup code MFA could not utilize material them yet.
1 parent 9b0dd72 commit b44572c

File tree

7 files changed

+163
-5
lines changed

7 files changed

+163
-5
lines changed

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,3 @@ errors:
1212
clean:
1313
docker-compose kill
1414
docker system prune -f
15-
16-
17-
# TODO: create local migrations for broker to load users and mfas to make testing easier.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ If configured, an alert will be shown to the user filled with the content of tha
158158
5. Click **hub-discovery**
159159
6. Click **idp4**
160160
7. Login as a "backup code" user: `username=`**has_backupcode** `password=`**a**
161-
7. TODO: add remaining steps
161+
8. Enter one fo the following codes to verify (`94923279, 82743523, 77802769, 01970541, 37771076, 39178450, 01813404, 00416843, 90068701, 35775442, 94923279, 82743523, 77802769, 01970541, 37771076, 39178450, 01813404, 00416843, 90068701, 35775442`)
162+
9. Click **Logout**
162163

163164
#### TOTP code
164165
1. Goto [http://ssp-hub.local](http://ssp-hub.local)

dictionaries/mfa.definition.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
{
3+
"title": {
4+
"en": "2-step verification",
5+
"es": "TODO",
6+
"fr": "TODO",
7+
"ko": "TODO"
8+
},
9+
"header": {
10+
"en": "2-step verification",
11+
"es": "TODO",
12+
"fr": "TODO",
13+
"ko": "TODO"
14+
},
15+
"backup_code_header": {
16+
"en": "Backup code",
17+
"es": "TODO",
18+
"fr": "TODO",
19+
"ko": "TODO"
20+
},
21+
"backup_code_icon": {
22+
"en": "Backup code icon",
23+
"es": "TODO",
24+
"fr": "TODO",
25+
"ko": "TODO"
26+
},
27+
"backup_code_reminder": {
28+
"en": "Each code can only be used once, so the code you enter this time will be used up and will not be available again.",
29+
"es": "TODO",
30+
"fr": "TODO",
31+
"ko": "TODO"
32+
},
33+
"backup_code_input": {
34+
"en": "Enter code",
35+
"es": "TODO",
36+
"fr": "TODO",
37+
"ko": "TODO"
38+
},
39+
"button_verify": {
40+
"en": "Verify",
41+
"es": "TODO",
42+
"fr": "TODO",
43+
"ko": "TODO"
44+
},
45+
"remember_this": {
46+
"en": "Remember this computer for 30 days",
47+
"es": "TODO",
48+
"fr": "TODO",
49+
"ko": "TODO"
50+
}
51+
}

themes/material/common-head-elements.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
$colors = htmlentities($this->configuration->getValue('theme.color-scheme', 'indigo-purple'));
3131
?>
3232
<link rel="stylesheet" href="/module.php/material/material.<?= $colors ?>.1.2.1.min.css">
33-
<link rel="stylesheet" href="/module.php/material/styles.2.2.0.css">
33+
<link rel="stylesheet" href="/module.php/material/styles.2.2.1.css">
3434

3535
<script async src="/module.php/material/material.1.2.1.min.js"></script>
3636

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title><?= $this->t('{material:mfa:title}') ?></title>
5+
6+
<?php include __DIR__ . '/../common-head-elements.php' ?>
7+
</head>
8+
<body class="gradient-bg">
9+
<div class="mdl-layout mdl-layout--fixed-header fill-viewport">
10+
<header class="mdl-layout__header">
11+
<div class="mdl-layout__header-row">
12+
<span class="mdl-layout-title">
13+
<?= $this->t('{material:mfa:header}') ?>
14+
</span>
15+
</div>
16+
</header>
17+
<main class="mdl-layout__content" layout-children="column">
18+
<form layout-children="column" method="POST">
19+
<?php
20+
foreach ($this->data['formData'] as $name => $value) {
21+
?>
22+
<input type="hidden" name="<?= htmlentities($name); ?>"
23+
value="<?= htmlentities($value); ?>"/>
24+
<?php
25+
}
26+
?>
27+
<div class="mdl-card mdl-shadow--8dp">
28+
<div class="mdl-card__media white-bg margin" layout-children="column">
29+
<img src="/module.php/material/mfa-backup-codes.svg"
30+
alt="<?= $this->t('{material:mfa:backup_code_icon}') ?>">
31+
</div>
32+
33+
<div class="mdl-card__title center">
34+
<h1 class="mdl-card__title-text">
35+
<?= $this->t('{material:mfa:backup_code_header}') ?>
36+
</h1>
37+
</div>
38+
39+
<div class="mdl-card__title" >
40+
<p class="mdl-card__subtitle-text">
41+
<?= $this->t('{material:mfa:backup_code_reminder}') ?>
42+
</p>
43+
</div>
44+
45+
<div class="mdl-card__supporting-text" layout-children="column">
46+
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
47+
<label for="mfaSubmission" class="mdl-textfield__label">
48+
<?= $this->t('{material:mfa:backup_code_input}') ?>
49+
</label>
50+
<input name="mfaSubmission" class="mdl-textfield__input" autofocus
51+
id="mfaSubmission"/>
52+
</div>
53+
</div>
54+
55+
<?php
56+
$message = $this->data['errorMessage'];
57+
58+
if (! empty($message)) {
59+
?>
60+
<div class="mdl-card__supporting-text" layout-children="column">
61+
<p class="mdl-color-text--red error">
62+
<i class="material-icons">error</i>
63+
64+
<span class="mdl-typography--caption">
65+
<?= htmlentities($message) ?>
66+
</span>
67+
</p>
68+
</div>
69+
70+
<script>
71+
ga('send','event','error','backupcode', <?= $message ?>');
72+
</script>
73+
<?php
74+
}
75+
?>
76+
77+
<div class="mdl-card__actions" layout-children="row">
78+
<span flex></span>
79+
<button type="submit" name="submitMfa"
80+
class="mdl-button mdl-button--raised mdl-button--primary">
81+
<?= $this->t('{material:mfa:button_verify}') ?>
82+
</button>
83+
</div>
84+
</div>
85+
86+
<div>
87+
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect">
88+
<span class="mdl-checkbox__label">
89+
<?= $this->t('{material:mfa:remember_this}') ?>
90+
</span>
91+
<input type="checkbox" name="rememberMe" value="true" checked
92+
class="mdl-checkbox__input"/>
93+
</label>
94+
</div>
95+
</form>
96+
</main>
97+
</div>
98+
</body>
99+
</html>

www/mfa-backup-codes.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
p {
2+
max-width: 60ch;
3+
}
4+
15
.fill-viewport {
26
width: 100vw;
37
height: 100vh;
@@ -68,6 +72,11 @@ form p.error > i {
6872
margin: 1em;
6973
}
7074

75+
/* don't want images to be too small on cards */
76+
.mdl-card__media > img {
77+
min-width: 20%;
78+
}
79+
7180
/* phones (2 cards / row) */
7281
@media only screen and (min-width : 320px) {
7382
.mdl-card.row-aware {

0 commit comments

Comments
 (0)