clarion 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/public/register.js +20 -0
- data/app/views/authn.erb +1 -1
- data/app/views/register.erb +4 -1
- data/lib/clarion/app.rb +1 -0
- data/lib/clarion/authenticator.rb +1 -1
- data/lib/clarion/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84a30b16b873057c9f6f6831b5a11827eef098caddaf3a4cb19047f081eb2ebb
|
4
|
+
data.tar.gz: cf47f7b89067fe1438a94f67556a6240feb17ea5e22968318bd6ab1b1ba3bec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d837f20219b82a12bc833268fe5edf9ebeb138013ff2f3481993ea6cb4ddaf3a214835f9c64f0775678cec3b2bf65dc2c62033806358707eac5434c6db916ca
|
7
|
+
data.tar.gz: a2cd1b1a58cba9438a46dd6a886ddb6c97a2382d4e4f4c8547a0dea11d6c493a468efe0e51464bec6e31cfa30554a91f1614e09f7f4ecfd471c88f312d9ef8c0
|
data/app/public/register.js
CHANGED
@@ -7,6 +7,7 @@ document.addEventListener("DOMContentLoaded", async function() {
|
|
7
7
|
processionElem.className = 'procession_unsupported';
|
8
8
|
};
|
9
9
|
if (!navigator.credentials) return handleUnsupported();
|
10
|
+
if (!window.PublicKeyCredential) return handleUnsupported();
|
10
11
|
|
11
12
|
const regId = processionElem.attributes['data-reg-id'].value;
|
12
13
|
const state = processionElem.attributes['data-state'].value;
|
@@ -19,6 +20,25 @@ document.addEventListener("DOMContentLoaded", async function() {
|
|
19
20
|
|
20
21
|
let attestation;
|
21
22
|
|
23
|
+
// "Force platform authenticator" link; This is especially for Chrome 70 Touch ID support.
|
24
|
+
// Until the WebAuthn dialog https://crbug.com/847985 is rolled out, the platform authenticators are needed to be chosen
|
25
|
+
// explicitly to enable Touch ID authenticator.
|
26
|
+
if (window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable) {
|
27
|
+
const platformAuthenticatorAvailability = await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();
|
28
|
+
if (platformAuthenticatorAvailability && location.hash == '#platform') {
|
29
|
+
creationOptions.publicKey.authenticatorSelection = {authenticatorAttachment: 'platform'};
|
30
|
+
} else if (platformAuthenticatorAvailability) {
|
31
|
+
document.querySelector('#force_platform_link').addEventListener('click', function(e) {
|
32
|
+
e.target.remove();
|
33
|
+
e.preventDefault();
|
34
|
+
// https://crbug.com/803833
|
35
|
+
location.hash = '#platform';
|
36
|
+
location.reload();
|
37
|
+
});
|
38
|
+
document.body.classList.add('platform-authenticator-available');
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
22
42
|
const startCreationRequest = async function() {
|
23
43
|
processionElem.className = 'procession_wait';
|
24
44
|
|
data/app/views/authn.erb
CHANGED
data/app/views/register.erb
CHANGED
@@ -26,6 +26,8 @@
|
|
26
26
|
#procession.procession_timeout > div.procession_timeout {
|
27
27
|
display: block;
|
28
28
|
}
|
29
|
+
#force_platform_link { display: none; }
|
30
|
+
body.platform-authenticator-available #force_platform_link { display: inline; }
|
29
31
|
</style>
|
30
32
|
|
31
33
|
<p><strong>U2F key registration<%- if @name -%> for <%= @name %><%- end -%></strong></p>
|
@@ -42,6 +44,7 @@
|
|
42
44
|
</div>
|
43
45
|
<div class="procession_wait">
|
44
46
|
<p>Insert and tap your security key.</p>
|
47
|
+
<p class='right'><a href='#' id="force_platform_link" class='text-muted'><small>Force platform authenticator (May enable Touch ID)</small></a></p>
|
45
48
|
</div>
|
46
49
|
<div class="procession_edit">
|
47
50
|
<p>Security key recognized:</p>
|
@@ -73,4 +76,4 @@
|
|
73
76
|
<%- end -%>
|
74
77
|
|
75
78
|
|
76
|
-
<script src="/register.js"></script>
|
79
|
+
<script src="/register.js?<%= Clarion::VERSION %>"></script>
|
data/lib/clarion/app.rb
CHANGED
@@ -262,6 +262,7 @@ module Clarion
|
|
262
262
|
challenge: challenge,
|
263
263
|
origin: request.base_url,
|
264
264
|
credential_id: data[:credential_id],
|
265
|
+
extension_results: data[:extension_results] || {},
|
265
266
|
authenticator_data: data[:authenticator_data].unpack('m*')[0],
|
266
267
|
client_data_json: data[:client_data_json].unpack('m*')[0],
|
267
268
|
signature: data[:signature].unpack('m*')[0],
|
@@ -54,7 +54,7 @@ module Clarion
|
|
54
54
|
raise Authenticator::InvalidKey
|
55
55
|
end
|
56
56
|
|
57
|
-
rp_id = extension_results&.fetch('appid', false) ? legacy_app_id : self.rp_id()
|
57
|
+
rp_id = extension_results&.fetch('appid', extension_results&.fetch(:appid, false)) ? legacy_app_id : self.rp_id()
|
58
58
|
allowed_credentials = authn.keys.map { |_| {id: _.handle, public_key: _.public_key_bytes} }
|
59
59
|
unless assertion.valid?(challenge, origin, rp_id: rp_id, allowed_credentials: allowed_credentials)
|
60
60
|
raise Authenticator::InvalidAssertion, "invalid assertion"
|
data/lib/clarion/version.rb
CHANGED