6743 |
19 May 22 |
nicklas |
1 |
<%@ page |
6743 |
19 May 22 |
nicklas |
2 |
pageEncoding="UTF-8" |
6743 |
19 May 22 |
nicklas |
3 |
session="false" |
6743 |
19 May 22 |
nicklas |
4 |
import="net.sf.basedb.core.SessionControl" |
6743 |
19 May 22 |
nicklas |
5 |
import="net.sf.basedb.core.DbControl" |
6743 |
19 May 22 |
nicklas |
6 |
import="net.sf.basedb.core.User" |
6743 |
19 May 22 |
nicklas |
7 |
import="net.sf.basedb.util.extensions.Extension" |
6743 |
19 May 22 |
nicklas |
8 |
import="net.sf.basedb.clients.web.Base" |
6743 |
19 May 22 |
nicklas |
9 |
import="net.sf.basedb.clients.web.util.HTML" |
6743 |
19 May 22 |
nicklas |
10 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
6787 |
04 Aug 22 |
nicklas |
11 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
6743 |
19 May 22 |
nicklas |
12 |
%> |
6743 |
19 May 22 |
nicklas |
13 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
6743 |
19 May 22 |
nicklas |
14 |
<% |
6743 |
19 May 22 |
nicklas |
15 |
// Get the JspContext that was created on the main edit page |
6743 |
19 May 22 |
nicklas |
16 |
final JspContext jspContext = (JspContext)request.getAttribute(JspContext.ATTRIBUTE_KEY); |
6743 |
19 May 22 |
nicklas |
17 |
final Extension extension = (Extension)request.getAttribute(JspContext.EXTENSION_KEY); |
6743 |
19 May 22 |
nicklas |
18 |
|
6743 |
19 May 22 |
nicklas |
19 |
// The current item is found in the context. NOTE! Can be null if a new item |
6743 |
19 May 22 |
nicklas |
20 |
final User user = (User)jspContext.getCurrentItem(); |
6743 |
19 May 22 |
nicklas |
21 |
|
6743 |
19 May 22 |
nicklas |
22 |
// Get the DbControl and SessionControl used to handle the request (do not close!) |
6743 |
19 May 22 |
nicklas |
23 |
final DbControl dc = jspContext.getDbControl(); |
6743 |
19 May 22 |
nicklas |
24 |
final SessionControl sc = dc.getSessionControl(); |
6743 |
19 May 22 |
nicklas |
25 |
final String ID = sc.getId(); |
6743 |
19 May 22 |
nicklas |
26 |
|
6747 |
23 May 22 |
nicklas |
27 |
final String webAuthnUserHandle = user == null ? null : (String)user.getExtended("webAuthnUserHandle"); |
6743 |
19 May 22 |
nicklas |
28 |
final String webAuthnSerial = user == null ? null : (String)user.getExtended("webAuthnSerial"); |
6743 |
19 May 22 |
nicklas |
29 |
|
6743 |
19 May 22 |
nicklas |
30 |
String HOME = jspContext.getHome(extension); |
6787 |
04 Aug 22 |
nicklas |
31 |
|
6787 |
04 Aug 22 |
nicklas |
32 |
ExtensionsControl ec = ExtensionsControl.get(null); |
6787 |
04 Aug 22 |
nicklas |
33 |
boolean passwordLessLoginFormIsEnabled = ec.isEnabled(ec.getExtension("net.sf.basedb.webauthn.login-form-passwordless")); |
6743 |
19 May 22 |
nicklas |
34 |
%> |
6743 |
19 May 22 |
nicklas |
35 |
<base:page type="include"> |
6743 |
19 May 22 |
nicklas |
36 |
<base:body> |
6743 |
19 May 22 |
nicklas |
37 |
<div id="webauthn-data" class="datacontainer" |
6743 |
19 May 22 |
nicklas |
38 |
data-home="<%=HOME%>" |
6743 |
19 May 22 |
nicklas |
39 |
></div> |
6743 |
19 May 22 |
nicklas |
40 |
<table class="fullform input100"> |
6743 |
19 May 22 |
nicklas |
41 |
<tr> |
6747 |
23 May 22 |
nicklas |
42 |
<th>User Handle</th> |
6743 |
19 May 22 |
nicklas |
43 |
<td> |
6747 |
23 May 22 |
nicklas |
44 |
<span id="webAuthnUserHandleHTML"><%=webAuthnUserHandle == null ? "<i>No WebAuthn</i>" : HTML.encodeTags(webAuthnUserHandle) %></span> |
6743 |
19 May 22 |
nicklas |
45 |
</td> |
6743 |
19 May 22 |
nicklas |
46 |
<td></td> |
6743 |
19 May 22 |
nicklas |
47 |
</tr> |
6743 |
19 May 22 |
nicklas |
48 |
<tr> |
6743 |
19 May 22 |
nicklas |
49 |
<th>Serial #</th> |
6743 |
19 May 22 |
nicklas |
50 |
<td> |
6743 |
19 May 22 |
nicklas |
51 |
<input type="text" name="ep.webAuthnSerial" id="webAuthnSerial" |
6743 |
19 May 22 |
nicklas |
52 |
value="<%=HTML.encodeTags(webAuthnSerial)%>" |
6743 |
19 May 22 |
nicklas |
53 |
maxlength="32"> |
6743 |
19 May 22 |
nicklas |
54 |
</td> |
6743 |
19 May 22 |
nicklas |
55 |
<td></td> |
6743 |
19 May 22 |
nicklas |
56 |
</tr> |
6743 |
19 May 22 |
nicklas |
57 |
<tr class="dynamic"> |
6756 |
01 Jun 22 |
nicklas |
58 |
<th></th> |
6743 |
19 May 22 |
nicklas |
59 |
<td> |
6743 |
19 May 22 |
nicklas |
60 |
<div style="padding: 1em;"> |
6747 |
23 May 22 |
nicklas |
61 |
<div id="no-webauthn" style="<%=webAuthnUserHandle == null ? "" : "display: none;"%>"> |
6743 |
19 May 22 |
nicklas |
62 |
|
6756 |
01 Jun 22 |
nicklas |
63 |
<div class="messagecontainer note" style="margin: 0; padding: 1em;"> |
6756 |
01 Jun 22 |
nicklas |
64 |
This user is currently not configured to login with a WebAuthn Security Key.<br> |
6756 |
01 Jun 22 |
nicklas |
65 |
Assign a security key to this user by inserting the key into a USB slot and <br> |
6756 |
01 Jun 22 |
nicklas |
66 |
click <b>Register</b> to initate the registration process. |
6785 |
03 Aug 22 |
nicklas |
67 |
<p style="margin-top: 0.5em;"> |
6785 |
03 Aug 22 |
nicklas |
68 |
<b>Password-less</b> login requires a security key that supports the FIDO2<br> |
6785 |
03 Aug 22 |
nicklas |
69 |
protocol and it must have a PIN enabled for protection. |
6787 |
04 Aug 22 |
nicklas |
70 |
<p style="margin-top: 0.5em;"> |
6787 |
04 Aug 22 |
nicklas |
71 |
<b>NOTE!</b> The password-less login form is currently: |
6787 |
04 Aug 22 |
nicklas |
72 |
<code><%=passwordLessLoginFormIsEnabled ? "ENABLED" : "DISABLED" %></code> |
6787 |
04 Aug 22 |
nicklas |
73 |
<br> |
6787 |
04 Aug 22 |
nicklas |
74 |
To change go to <b>Admnistrate › Plug-ins & extensions › Overview</b><br> |
6787 |
04 Aug 22 |
nicklas |
75 |
and locate the <i>Login form customization</i> extension point. |
6743 |
19 May 22 |
nicklas |
76 |
</div> |
6785 |
03 Aug 22 |
nicklas |
77 |
|
6785 |
03 Aug 22 |
nicklas |
78 |
<div style="text-align: center; margin-top: 0.5em;"> |
6787 |
04 Aug 22 |
nicklas |
79 |
<label><input type="checkbox" name="passwordLess" id="passwordLess" |
6787 |
04 Aug 22 |
nicklas |
80 |
<%=passwordLessLoginFormIsEnabled ? "checked" : "" %> |
6787 |
04 Aug 22 |
nicklas |
81 |
>Enable password-less login</label> |
6785 |
03 Aug 22 |
nicklas |
82 |
</div> |
6743 |
19 May 22 |
nicklas |
83 |
|
6785 |
03 Aug 22 |
nicklas |
84 |
<base:buttongroup style="margin-top: 0.5em;"> |
6743 |
19 May 22 |
nicklas |
85 |
<base:button id="btnWebAuthnRegister" title="Register..." image="add.png" /> |
6743 |
19 May 22 |
nicklas |
86 |
</base:buttongroup> |
6743 |
19 May 22 |
nicklas |
87 |
|
6743 |
19 May 22 |
nicklas |
88 |
<div id="webauthn-error" class="messagecontainer error" |
6743 |
19 May 22 |
nicklas |
89 |
style="display: none; margin: 0; margin-top: 1em;"> |
6743 |
19 May 22 |
nicklas |
90 |
</div> |
6743 |
19 May 22 |
nicklas |
91 |
</div> |
6743 |
19 May 22 |
nicklas |
92 |
|
6747 |
23 May 22 |
nicklas |
93 |
<div id="has-webauthn" style="<%=webAuthnUserHandle == null ? "display: none;" : ""%>"> |
6756 |
01 Jun 22 |
nicklas |
94 |
<div class="messagecontainer note" style="text-align: center; margin: 0; padding: 1em;"> |
6756 |
01 Jun 22 |
nicklas |
95 |
This user is currently configured to login with a WebAuthn Security Key.<br> |
6743 |
19 May 22 |
nicklas |
96 |
Click <b>Remove</b> to remove the key from this user. |
6743 |
19 May 22 |
nicklas |
97 |
</div> |
6743 |
19 May 22 |
nicklas |
98 |
|
6743 |
19 May 22 |
nicklas |
99 |
<base:buttongroup style="margin-top: 1em;"> |
6743 |
19 May 22 |
nicklas |
100 |
<base:button id="btnWebAuthnRemove" title="Remove" /> |
6743 |
19 May 22 |
nicklas |
101 |
</base:buttongroup> |
6743 |
19 May 22 |
nicklas |
102 |
</div> |
6743 |
19 May 22 |
nicklas |
103 |
</div> |
6743 |
19 May 22 |
nicklas |
104 |
|
6743 |
19 May 22 |
nicklas |
105 |
</td> |
6743 |
19 May 22 |
nicklas |
106 |
<td></td> |
6743 |
19 May 22 |
nicklas |
107 |
</tr> |
6743 |
19 May 22 |
nicklas |
108 |
</table> |
6743 |
19 May 22 |
nicklas |
109 |
</base:body> |
6743 |
19 May 22 |
nicklas |
110 |
</base:page> |
6743 |
19 May 22 |
nicklas |
111 |
|