-
Notifications
You must be signed in to change notification settings - Fork 0
/
mfa-enroll.html
97 lines (96 loc) · 5.12 KB
/
mfa-enroll.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MFA Enroll</title>
<!-- CSS -->
<link rel="stylesheet" th:href="@{../assets/material/material.blue_grey-blue.min.css}"/>
<link rel="stylesheet" th:href="@{../assets/material/material.icons.css}"/>
<link rel="stylesheet" th:href="@{../assets/font-awesome/css/font-awesome.min.css}"/>
<link rel="stylesheet" th:href="@{../assets/css/mfa_enroll.css}"/>
<!-- Favicon and touch icons -->
<link rel="shortcut icon" th:href="@{../assets/ico/favicon.ico}"/>
</head>
<body>
<div class="mdl-layout mdl-js-layout">
<div class="mfa-enroll-container">
<div class="mfa-enroll-form">
<div class="mfa-enroll-form-title">
<label>Multi-Factor Auth Setup</label>
</div>
<form role="form" th:action="${action}" method="post" th:each="factor : ${factors}">
<div th:if="${factor.factorType == 'TOTP'}" class="mfa-enroll-form-description">
<div>
<ul class="mdl-list">
<li class="mdl-list__item mdl-list__item--three-line">
<span class="mdl-list__item-primary-content">
<i class="material-icons mdl-list__item-avatar">cloud_download</i>
<span>1. Download a mobile app</span>
<span class="mdl-list__item-text-body">
Download and install a two-factor authenticator application like <i>FreeOTP</i> or <i>Google Authenticator</i>.
</span>
</span>
</li>
<li class="mdl-list__item mdl-list__item--three-line">
<span class="mdl-list__item-primary-content">
<i class="material-icons mdl-list__item-avatar">settings</i>
<span>2. Configure the app</span>
<span class="mdl-list__item-text-body">
Open the application and scan the barcode. A one-time password code will be displayed to the screen.
</span>
</span>
</li>
<li class="mdl-list__item mdl-list__item--three-line">
<span class="mdl-list__item-primary-content">
<i class="material-icons mdl-list__item-avatar">rotate_right</i>
<span>3. Finish set up</span>
<span class="mdl-list__item-text-body">
Go to the next step and enter the code provided by the application.
</span>
</span>
</li>
</ul>
</div>
<div>
<img th:src="${factor.enrollment.barcode}" width="200" />
</div>
<input type="hidden" th:name="sharedSecret" th:value="${factor.enrollment.key}" />
</div>
<div th:if="${error}" class="mfa-enroll-error-info">
<span>
<span class="error" th:text="${error}"></span>
<small class="error_description" th:text="*{error_description}?: 'Error during enrollment'"></small>
</span>
</div>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" th:name="factorId" th:value="${factor.id}" />
<div class="mfa-enroll-form-actions">
<button type="submit" name="user_mfa_enrollment" value="false" class="button--skipped">Skip for now</button>
<span style="flex: 1 1 0%;"></span>
<button type="submit" name="user_mfa_enrollment" value="true" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">Next</button>
</div>
</form>
</div>
</div>
</div>
<!--[if lt IE 10]>
<script th:src="@{assets/js/placeholder.js}"></script>
<![endif]-->
<script th:src="@{../assets/material/material.min.js}"></script>
<script th:src="@{../assets/js/jquery-3.5.1.min.js}"></script>
<script>
$(".mdl-textfield__input").focus(function() {
if (!this.value) {
$(this).prop('required', true);
$(this).parent().addClass('is-invalid');
}
});
$(".mdl-button[type='submit']").click(function(event) {
$(this).siblings(".mdl-textfield").addClass('is-invalid');
$(this).siblings(".mdl-textfield").children(".mdl-textfield__input").prop('required', true);
});
</script>
</body>
</html>