[java-idp-plugin-webauthn] branch main updated: Remove unused resources
Phil Smart
philip.smart at jisc.ac.uk
Fri Jan 26 17:13:41 UTC 2024
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch main
in repository java-idp-plugin-webauthn.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-webauthn.git;a=commit;h=6209fc48475c85c7039b27ee8942a1991b9cdfa9
The following commit(s) were added to refs/heads/main by this push:
new 6209fc4 Remove unused resources
6209fc4 is described below
commit 6209fc48475c85c7039b27ee8942a1991b9cdfa9
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Jan 26 17:13:39 2024 +0000
Remove unused resources
---
.../example-webauthn-request-yubico.json | 63 --
resources/javascript/index.html | 114 ---
resources/javascript/placeholder.css | 802 ---------------------
resources/javascript/webauthn-json.js | 192 -----
resources/javascript/webauthn-shib.js | 137 ----
5 files changed, 1308 deletions(-)
diff --git a/resources/javascript/example-webauthn-request-yubico.json b/resources/javascript/example-webauthn-request-yubico.json
deleted file mode 100644
index 75b9c40..0000000
--- a/resources/javascript/example-webauthn-request-yubico.json
+++ /dev/null
@@ -1,63 +0,0 @@
-{
- "success": true,
- "request": {
- "username": "",
- "credentialNickname": "",
- "requestId": "_-Mmw_rKUdlZIYez0Iz5c12zd8xxiexOmaPpx1213c8",
- "publicKeyCredentialCreationOptions": {
- "rp": {
- "name": "Yubico WebAuthn demo",
- "id": "localhost"
- },
- "user": {
- "name": "",
- "displayName": "",
- "id": "2Pp4ZXaN5_9AhXwD4Sh3aHZ01PiePBJ8gz9n8h4LbeM"
- },
- "challenge": "ZLxqs6DgjZECnbjeIpKLXEPKEWKVwKr-UaGYAjvwQc0",
- "pubKeyCredParams": [
- {
- "alg": -7,
- "type": "public-key"
- },
- {
- "alg": -8,
- "type": "public-key"
- },
- {
- "alg": -35,
- "type": "public-key"
- },
- {
- "alg": -36,
- "type": "public-key"
- },
- {
- "alg": -257,
- "type": "public-key"
- },
- {
- "alg": -258,
- "type": "public-key"
- },
- {
- "alg": -259,
- "type": "public-key"
- }
- ],
- "excludeCredentials": [],
- "authenticatorSelection": {
- "requireResidentKey": true,
- "residentKey": "required"
- },
- "attestation": "direct",
- "extensions": {
- "credProps": true
- }
- },
- "sessionToken": "nJEWdhxUNNX3S6lKE0v82U7W_mYJQ0X2VT2Y12R2WfI"
- },
- "actions": {
- "finish": "https://localhost:8443/api/v1/register/finish"
- }
-}
diff --git a/resources/javascript/index.html b/resources/javascript/index.html
deleted file mode 100644
index 686d219..0000000
--- a/resources/javascript/index.html
+++ /dev/null
@@ -1,114 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
- <title>Test Register Page</title>
- <meta charset="UTF-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
- <link rel="stylesheet" type="text/css" href="placeholder.css">
- <script src="webauthn-shib.js"></script>
- <script src="webauthn-json.js"></script>
-
- <script>// type="module">
- if (!window.PublicKeyCredential) {
- console.log("WebAuthn not supported");
- }
-
- async function register() {
- console.log("Register");
- var pkCredOptions = {
- "rp": {
- "name": "Yubico WebAuthn demo",
- "id": "localhost"
- },
- "user": {
- "name": "",
- "displayName": "",
- "id": "2Pp4ZXaN5_9AhXwD4Sh3aHZ01PiePBJ8gz9n8h4LbeM"
- },
- "challenge": "ZLxqs6DgjZECnbjeIpKLXEPKEWKVwKr-UaGYAjvwQc0",
- "pubKeyCredParams": [
- {
- "alg": -7,
- "type": "public-key"
- },
- {
- "alg": -8,
- "type": "public-key"
- },
- {
- "alg": -35,
- "type": "public-key"
- },
- {
- "alg": -36,
- "type": "public-key"
- },
- {
- "alg": -257,
- "type": "public-key"
- },
- {
- "alg": -258,
- "type": "public-key"
- },
- {
- "alg": -259,
- "type": "public-key"
- }
- ],
- "excludeCredentials": [],
- "authenticatorSelection": {
- "requireResidentKey": true,
- "residentKey": "required"
- },
- "attestation": "direct",
- "extensions": {
- "credProps": true
- }
- };
-
- console.log("Raw request options", pkCredOptions);
- const credential = await create({ publicKey: pkCredOptions }).catch(console.error);
- console.log("Credential: ",credential);
- try {
- document.getElementById("publicKeyCredential").value = JSON.stringify(credential);
- } catch (err) {
- console.log(err);
- }
- }
-
- function init() {
- document.getElementById("registerButton").onclick = register;
- return false;
- }
-
- window.onload = init;
-
- </script>
-
-</head>
-
-
-
-<body>
-
- <main class="main">
- <section>
- <div class="content">
- <div class="column one">
- <button class="form-element form-button" id="registerButton">Register</button>
- <form action="$flowExecutionUrl" method="post">
- <textarea id="publicKeyCredential" name="publicKeyCredential" rows="10" cols="50"></textarea>
- <button id="reg-submit" type="submit" name="_eventId_proceed">Submit Registration</button>
- </form>
- </div>
- </div>
- </section>
- </main>
- </div>
-
-</body>
-
-</html>
diff --git a/resources/javascript/placeholder.css b/resources/javascript/placeholder.css
deleted file mode 100644
index c1dbe1c..0000000
--- a/resources/javascript/placeholder.css
+++ /dev/null
@@ -1,802 +0,0 @@
-/* Colours pallet
-
-To change the colours, use find and replace with the values below:
-
- #ECEFF1 - Body background, header / section border, read only / disabled input fields.
-
- #1534E3 - Links, buttons, list items, selected radio, selected checkbox.
-
- #1A237E - Hover buttons.
-
- #32424A - Body text, input fields border.
-
- #7A2D00 - Output message.
-
- #B50024 - Error messages / fields.
-
- #1C7D40 - Success messages / fields.
-
- #999999 - read only / disabled input fields.
-
-*/
-
-html, html * {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
- box-sizing: border-box;
- background: none;
- background-repeat: no-repeat;
- background-position: left top;
- border: 0;
- outline: 0;
-}
-
-html {
- height: 100%;
-}
-
-/* HTML5 display-role reset for older browsers */
-article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, main {
- display: block;
-}
-
-/* Default document styles - fonts, font sizes, text colours, font weight */
-body {
- font-family: Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
- font-size: 16px;
- font-size: 1rem;
- line-height: 24px;
- line-height: 1.5rem;
- color: #32424a;
- font-weight: 400;
- max-width: 3000px;
- margin: 0 auto;
- background-color: #eceff1;
- padding: 24px;
-}
-
-/* Links */
-a[href] {
- text-decoration: none;
- color: #1534e3;
-}
-
-/* Link hover states */
-a[href]:hover, a[href]:active, a[href]:focus {
- text-decoration: underline;
- color: #1534e3;
-}
-
-/* Heading styles */
-h1 {
- font-size: 24px;
- font-size: 1.5rem;
- line-height: 28px;
- line-height: 1.75rem;
- font-weight: 700;
-}
-
-h2 {
- font-size: 20px;
- font-size: 1.25rem;
- line-height: 25px;
- line-height: 1.5rem;
- font-weight: 400;
-}
-
-h3 {
- font-size: 16px;
- font-size: 1rem;
- line-height: 22px;
- line-height: 1.375rem;
- font-weight: 700;
-}
-
-h4 {
- font-size: 14px;
- font-size: 0.875rem;
- line-height: 18px;
- line-height: 1.125rem;
- font-weight: 700;
- margin-bottom: 0.5em;
-}
-
-h5 {
- font-size: 14px;
- font-size: 0.875rem;
- line-height: 18px;
- line-height: 1.125rem;
- font-weight: 400;
-}
-
-h1, h2, h3, h4, h5, h6, p {
- margin-bottom: 1em;
-}
-
-h1:last-child, h2:last-child, h3:last-child, h4:last-child, h5:last-child, h6:last-child, p:last-child {
- margin-bottom: 0px;
-}
-
-/* List styles */
-ol, ul {
- list-style: none;
- margin: 20px 0;
-}
-
-ol:before, ol:after,
-ul:before, ul:after {
- content: " ";
- display: table;
-}
-
-ol:after,
-ul:after {
- clear: both;
-}
-
-ol:last-child,
-ul:last-child {
- margin-bottom: 0px;
-}
-
-ol:first-child,
-ul:first-child {
- margin-top: 0px;
-}
-
-ul li {
- padding-left: 22px;
- margin-bottom: 4px;
- position: relative;
- list-style: none;
-}
-
-ul li:last-child {
- margin-bottom: 0px;
-}
-
-ul li:before {
- content: '';
- -webkit-border-radius: 2px;
- -ms-border-radius: 2px;
- -moz-border-radius: 2px;
- -o-border-radius: 2px;
- border-radius: 2px;
- background-color: #1534e3;
- height: 7px;
- width: 7px;
- display: block;
- position: absolute;
- left: 0;
- top: 7px;
-}
-
-ol {
- counter-reset: item;
-}
-
-ol li {
- padding-left: 22px;
- margin-bottom: 10px;
- position: relative;
- list-style: none;
-}
-
-ol li:last-child {
- margin-bottom: 0px;
-}
-
-ol li:before {
- color: #1534e3;
- position: absolute;
- left: 0;
- content: counter(item) ". ";
- counter-increment: item;
- font-weight: 700;
- top: 1px;
-}
-
-ol li:nth-child(n+10) {
- padding-left: 30px;
-}
-
-ol li:nth-child(n+100) {
- padding-left: 38px;
-}
-
-hr {
- width: 100%;
- clear: both;
- border: 0;
- outline: 0;
- background-color: #eceff1;
- height: 1px;
- display: block;
- margin: 30px 0;
-}
-
-b, strong {
- font-weight: 700;
-}
-
-i, em {
- font-style: italic;
-}
-
-small {
- font-size: 0.8em;
-}
-
-big {
- font-size: 1.2em;
-}
-
-.cc {
- clear: both;
- margin: 0 auto;
- width: 100%;
- max-width: 649px;
- padding: 0 0;
-}
-
-.cc:before, .cc:after {
- content: " ";
- display: table;
-}
-
-.cc:after {
- clear: both;
-}
-
-img {
- max-width: 100%;
- height: auto;
-}
-
-/* Main content area */
-main {
- clear: both;
- margin: 0 auto;
- width: 100%;
- max-width: 800px;
- background-color: #fff;
- -webkit-border-radius: 8px;
- -ms-border-radius: 8px;
- -moz-border-radius: 8px;
- -o-border-radius: 8px;
- border-radius: 8px;
- -webkit-box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
- -ms-box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
- -moz-box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
- -o-box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
- box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
-}
-
-/* Add a border top when 2 sections are together */
-main section + section {
- border-top: 1px solid #eceff1;
-}
-
-/* Header */
-header {
- display: block; /* Change to display: none to hide */
- border-bottom: 1px solid #eceff1;
- text-align: center;
- padding: 6% 8%;
-}
-
-header .main-logo {
- display: block;
- margin: 0 auto;
-}
-
-.service-logo {
- display: block;
- margin: 24px 0;
-}
-
-section {
- padding: 4% 8% 4% 8%;
-}
-
-/* Output Messages */
-.output-message {
- font-size: 14px;
- font-size: 0.875rem;
- line-height: 18px;
- line-height: 1.125rem;
- font-style: italic;
- -webkit-border-radius: 4px;
- -ms-border-radius: 4px;
- -moz-border-radius: 4px;
- -o-border-radius: 4px;
- border-radius: 4px;
- background-color: #FFD8C2;
- display: block;
- padding: 4%;
- margin-bottom: 20px;
- color: #7A2D00;
-}
-
-.output-message:last-child {
- margin-bottom: 0px;
-}
-
-/* Output Message Success */
-.output-message.output--success {
- background-color: #DCF9E7;
- color: #1C7D40;
-}
-
-/* Output Message Error */
-.output-message.output--error {
- background-color: #FFF0F3;
- color: #B50024;
-}
-
-.boxed {
- -webkit-border-radius: 4px;
- -ms-border-radius: 4px;
- -moz-border-radius: 4px;
- -o-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
- -ms-box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
- -moz-box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
- -o-box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
- box-shadow: 0px 0px 10px 0px rgba(38, 50, 56, 0.11);
- background-color: #fff;
- padding: 6%;
- margin: 30px 0;
-}
-
-.boxed:last-child {
- margin-bottom: 0px;
-}
-
-.boxed:first-child {
- margin-top: 0px;
-}
-
-/* Footer style */
-footer {
- z-index: 1;
- position: relative;
- text-align: center;
- margin-top: 20px;
- font-size: 12px;
- font-size: 0.75rem;
- line-height: 16px;
- line-height: 1rem;
-}
-
-/* Forms styles */
-fieldset {
- display: block;
- margin-bottom: 20px;
-}
-
-fieldset:last-child {
- margin-bottom: 0px;
-}
-
-fieldset .field-validation {
- display: block;
- margin-top: 10px;
-}
-
-fieldset .error {
- color: #B50024;
-}
-
-fieldset legend span {
- display: block;
- text-indent: 100%;
- white-space: nowrap;
- overflow: hidden;
- height: 0;
-}
-
-/* Form labels */
-label {
- vertical-align: top;
- font-size: 14px;
- font-size: 0.875rem;
- line-height: 18px;
- line-height: 1.125rem;
- font-weight: 700;
- display: block;
- color: #32424a;
- margin-bottom: 6px;
-}
-
-label:focus {
- color: #1534E3;
-}
-
-/* Form input fields */
-input[type="text"],
-input[type="email"],
-input[type="password"],
-input[type="telephone"],
-input[type="tel"],
-input[type="url"],
-textarea,
-select {
- background-color: #fff;
- border: 2px solid #32424a;
- -webkit-transition: all 0.3s ease-in-out;
- -moz-transition: all 0.3s ease-in-out;
- -ms-transition: all 0.3s ease-in-out;
- -o-transition: all 0.3s ease-in-out;
- transition: all 0.3s ease-in-out;
- color: #32424a;
- padding: 13px 20px;
- display: block;
- width: 100%;
- -webkit-appearance: none;
- -ms-appearance: none;
- -moz-appearance: none;
- -o-appearance: none;
- appearance: none;
- -webkit-border-radius: 4px;
- -ms-border-radius: 4px;
- -moz-border-radius: 4px;
- -o-border-radius: 4px;
- border-radius: 4px;
-}
-
-/* Form input focus */
-input[type="text"]:focus,
-input[type="email"]:focus,
-input[type="password"]:focus,
-input[type="telephone"]:focus,
-input[type="tel"]:focus,
-input[type="url"]:focus,
-textarea:focus,
-select:focus,
-input[type="text"]:active,
-input[type="email"]:active,
-input[type="password"]:active,
-input[type="telephone"]:active,
-input[type="tel"]:active,
-input[type="url"]:active,
-textarea:active,
-select:active {
- border-color: #1534e3;
- background-color: #fff;
-}
-
-/* Form input errors */
-input[type="text"].error,
-input[type="email"].error,
-input[type="password"].error,
-input[type="telephone"].error,
-input[type="tel"].error,
-input[type="url"].error,
-textarea.error,
-select.error {
- border-color: #B50024;
-}
-
-/* Form input read only / disabled */
-input[type="text"]:read-only,
-input[type="email"]:read-only,
-input[type="password"]:read-only,
-input[type="telephone"]:read-only,
-input[type="tel"]:read-only,
-input[type="url"]:read-only,
-textarea:read-only,
-select:read-only,
-input[type="text"]:disabled,
-input[type="email"]:disabled,
-input[type="password"]:disabled,
-input[type="telephone"]:disabled,
-input[type="tel"]:disabled,
-input[type="url"]:disabled,
-textarea:disabled,
-select:disabled {
- background-color: #ECEFF1;
- pointer-events: none;
-}
-
-/* Text areas */
-textarea {
- height: 124px;
- resize: none;
-}
-
-
-/* Dropdowns */
-select {
- -webkit-appearance: auto;
- -ms-appearance: auto;
- -moz-appearance: auto;
- -o-appearance: auto;
- appearance: auto;
-}
-
-select:read-only {
- background-color: #fff;
- pointer-events: unset;
-}
-
-select::-ms-expand {
- display: none;
-}
-
-/* Checkboxes / Radio buttons */
-input[type="checkbox"], input[type="radio"] {
- position : absolute;
- opacity: 0;
- height: 0;
- width: 0;
-}
-
-input[type="checkbox"] + label, input[type="radio"] + label {
- display: block;
- font-weight: 400;
- font-size: 16px;
- font-size: 1rem;
- line-height: 24px;
- line-height: 1.5rem;
- cursor: pointer;
- position: relative;
- padding-left: 30px;
- padding-top: 3px;
- margin-bottom: 4px;
- margin-right: 12px;
- display: inline-block;
-}
-
-input[type="checkbox"] + label:before, input[type="radio"] + label:before {
- content: "";
- position: absolute;
- top: 2px;
- left: 0;
- height: 20px;
- width: 20px;
- background-color: #fff;
- border: 2px solid #32424a;
- -webkit-transition: all 0.2s ease-out;
- -ms-transition: all 0.2s ease-out;
- -moz-transition: all 0.2s ease-out;
- -o-transition: all 0.2s ease-out;
- transition: all 0.2s ease-out;
-}
-
-input[type="checkbox"] + label:after, input[type="radio"] + label:after {
- content: "";
- position: absolute;
- -webkit-transform: rotate(45deg);
- -ms-transform: rotate(45deg);
- -moz-transform: rotate(45deg);
- -o-transform: rotate(45deg);
- transform: rotate(45deg);
- display: none;
-}
-
-input[type="checkbox"]:checked + label, input[type="radio"]:checked + label,
-input[type="checkbox"]:focus + label, input[type="radio"]:focus + label {
- color: #1534e3;
-}
-
-input[type="checkbox"]:checked + label:before, input[type="radio"]:checked + label:before,
-input[type="checkbox"]:focus + label:before, input[type="radio"]:focus + label:before {
- border-color: #1534e3;
-}
-
-input[type="checkbox"]:checked + label:after, input[type="radio"]:checked + label:after {
- display: block;
-}
-
-input[type="checkbox"] + label:before {
- -webkit-border-radius: 4px;
- -ms-border-radius: 4px;
- -moz-border-radius: 4px;
- -o-border-radius: 4px;
- border-radius: 4px;
-}
-
-input[type="checkbox"] + label:after {
- left: 8px;
- top: 5px;
- width: 4px;
- height: 10px;
- border: solid #1534e3;
- border-width: 0 4px 4px 0;
-}
-
-input[type="radio"] + label:before {
- -webkit-border-radius: 100%;
- -ms-border-radius: 100%;
- -moz-border-radius: 100%;
- -o-border-radius: 100%;
- border-radius: 100%;
-}
-
-input[type="radio"] + label:after {
- background-color: #1534e3;
- height: 12px;
- width: 12px;
- -webkit-border-radius: 100%;
- -ms-border-radius: 100%;
- -moz-border-radius: 100%;
- -o-border-radius: 100%;
- border-radius: 100%;
- left: 6px;
- top: 8px;
-}
-
-/* Buttons / Submit buttons */
-button, input[type=button],
-input[type=submit],
-a.button,
-.button {
- display: inline-block;
- text-align: center;
- background-color: #1534e3;
- border: 4px solid #1534e3;
- font-weight: 700;
- padding: 11px 74px;
- cursor: pointer;
- color: #fff;
- -webkit-appearance: none;
- -ms-appearance: none;
- -moz-appearance: none;
- -o-appearance: none;
- appearance: none;
- -webkit-border-radius: 4px;
- -ms-border-radius: 4px;
- -moz-border-radius: 4px;
- -o-border-radius: 4px;
- border-radius: 4px;
- -webkit-transition: all 0.2s ease-out;
- -ms-transition: all 0.2s ease-out;
- -moz-transition: all 0.2s ease-out;
- -o-transition: all 0.2s ease-out;
- transition: all 0.2s ease-out;
-}
-
-/* Button hover & focus states */
-button:hover,
-input[type=button]:hover,
-input[type=submit]:hover,
-a.button:hover,
-.button:hover,
-button:focus,
-input[type=button]:focus,
-input[type=submit]:focus,
-a.button:focus,
-.button:focus {
- background: #1a237e;
- color: #fff !important;
- text-decoration: none !important;
- border-color: #1a237e;
-}
-
-/* Secondary button styles */
-button.button--secondary,
-input[type=button].button--secondary,
-input[type=submit].button--secondary,
-a.button.button--secondary,
-.button.button--secondary {
- background-color: transparent;
- border-color: #1534e3;
- color: #1534e3;
-}
-
-/* Secondary button hover & focus states */
-button.button--secondary:hover,
-input[type=button].button--secondary:hover,
-input[type=submit].button--secondary:hover,
-a.button.button--secondary:hover,
-.button.button--secondary:hover,
-button.button--secondary:focus,
-input[type=button].button--secondary:focus,
-input[type=submit].button--secondary:focus,
-a.button.button--secondary:focus,
-.button.button--secondary:focus {
- background: #1a237e;
- border-color: #1a237e;
-}
-
-/* Secondary button disabled states */
-button.button--secondary:disabled,
-input[type=button].button--secondary:disabled,
-input[type=submit].button--secondary:disabled,
-a.button.button--secondary:disabled,
-.button.button--secondary:disabled {
- background-color: transparent;
- color: #999999;
-}
-
-/* Full width buttons */
-button.button--full,
-input[type=button].button--full,
-input[type=submit].button--full,
-a.button.button--full,
-.button.button--full {
- width: 100%;
- padding-left: 30px;
- padding-right: 30px;
-}
-
-/* Button disabled states */
-button:disabled,
-input[type=button]:disabled,
-input[type=submit]:disabled,
-a.button:disabled,
-.button:disabled {
- pointer-events: none;
- background-color: #999999;
- border-color: #999999;
-}
-
-/* Placeholder styles */
-::-webkit-input-placeholder {
- color: #a9b0b4;
-}
-
-:-moz-placeholder {
- color: #a9b0b4;
-}
-
-::-moz-placeholder {
- color: #a9b0b4;
-}
-
-:-ms-input-placeholder {
- color: #a9b0b4;
-}
-
-.grid {
- margin-top: 12px;
-}
-
-/* Grid (used for 2 columns) */
-.grid:before, .grid:after {
- content: " ";
- display: table;
-}
-
-.grid:after {
- clear: both;
-}
-
-.grid > .grid-item {
- margin-bottom: 18px;
- min-height: 1px;
- width: 100%;
-}
-
-.grid:last-child > .item:last-child {
- margin-bottom: 0px;
-}
-
- at media screen and (min-width: 760px) {
-
- .grid.md-2 > .grid-item {
- float: left;
- width: 48.34436%;
- margin-right: 3.31126%;
- }
-
- .grid.md-2 > .grid-item:nth-child(n), .grid.md-2 > .grid-item:nth-of-type(n) {
- margin-right: 3.31126%;
- clear: none;
- }
-
- .grid.md-2 > .grid-item:nth-child(2n) {
- margin-right: 0;
- }
-
- .grid.md-2 > .grid-item:nth-child(2n+1) {
- clear: both;
- }
-
-}
diff --git a/resources/javascript/webauthn-json.js b/resources/javascript/webauthn-json.js
deleted file mode 100644
index ec0ed6f..0000000
--- a/resources/javascript/webauthn-json.js
+++ /dev/null
@@ -1,192 +0,0 @@
-// src/webauthn-json/base64url.ts
-function base64urlToBuffer(baseurl64String) {
- const padding = "==".slice(0, (4 - baseurl64String.length % 4) % 4);
- const base64String = baseurl64String.replace(/-/g, "+").replace(/_/g, "/") + padding;
- const str = atob(base64String);
- const buffer = new ArrayBuffer(str.length);
- const byteView = new Uint8Array(buffer);
- for (let i = 0; i < str.length; i++) {
- byteView[i] = str.charCodeAt(i);
- }
- return buffer;
- }
- function bufferToBase64url(buffer) {
- const byteView = new Uint8Array(buffer);
- let str = "";
- for (const charCode of byteView) {
- str += String.fromCharCode(charCode);
- }
- const base64String = btoa(str);
- const base64urlString = base64String.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
- return base64urlString;
- }
-
- // src/webauthn-json/convert.ts
- var copyValue = "copy";
- var convertValue = "convert";
- function convert(conversionFn, schema2, input) {
- if (schema2 === copyValue) {
- return input;
- }
- if (schema2 === convertValue) {
- return conversionFn(input);
- }
- if (schema2 instanceof Array) {
- return input.map((v) => convert(conversionFn, schema2[0], v));
- }
- if (schema2 instanceof Object) {
- const output = {};
- for (const [key, schemaField] of Object.entries(schema2)) {
- if (schemaField.deriveFn) {
- const v = schemaField.deriveFn(input);
- if (v !== void 0) {
- input[key] = v;
- }
- }
- if (!(key in input)) {
- if (schemaField.required) {
- throw new Error(`Missing key: ${key}`);
- }
- continue;
- }
- if (input[key] == null) {
- output[key] = null;
- continue;
- }
- output[key] = convert(conversionFn, schemaField.schema, input[key]);
- }
- return output;
- }
- }
- function derived(schema2, deriveFn) {
- return {
- required: true,
- schema: schema2,
- deriveFn
- };
- }
- function required(schema2) {
- return {
- required: true,
- schema: schema2
- };
- }
- function optional(schema2) {
- return {
- required: false,
- schema: schema2
- };
- }
-
- // src/webauthn-json/basic/schema.ts
- var publicKeyCredentialDescriptorSchema = {
- type: required(copyValue),
- id: required(convertValue),
- transports: optional(copyValue)
- };
- var simplifiedExtensionsSchema = {
- appid: optional(copyValue),
- appidExclude: optional(copyValue),
- credProps: optional(copyValue)
- };
- var simplifiedClientExtensionResultsSchema = {
- appid: optional(copyValue),
- appidExclude: optional(copyValue),
- credProps: optional(copyValue)
- };
- var credentialCreationOptions = {
- publicKey: required({
- rp: required(copyValue),
- user: required({
- id: required(convertValue),
- name: required(copyValue),
- displayName: required(copyValue)
- }),
- challenge: required(convertValue),
- pubKeyCredParams: required(copyValue),
- timeout: optional(copyValue),
- excludeCredentials: optional([publicKeyCredentialDescriptorSchema]),
- authenticatorSelection: optional(copyValue),
- attestation: optional(copyValue),
- extensions: optional(simplifiedExtensionsSchema)
- }),
- signal: optional(copyValue)
- };
- var publicKeyCredentialWithAttestation = {
- type: required(copyValue),
- id: required(copyValue),
- rawId: required(convertValue),
- response: required({
- clientDataJSON: required(convertValue),
- attestationObject: required(convertValue),
- transports: derived(copyValue, (response) => response.getTransports?.() || [])
- }),
- clientExtensionResults: derived(simplifiedClientExtensionResultsSchema, (pkc) => pkc.getClientExtensionResults())
- };
- var credentialRequestOptions = {
- mediation: optional(copyValue),
- publicKey: required({
- challenge: required(convertValue),
- timeout: optional(copyValue),
- rpId: optional(copyValue),
- allowCredentials: optional([publicKeyCredentialDescriptorSchema]),
- userVerification: optional(copyValue),
- extensions: optional(simplifiedExtensionsSchema)
- }),
- signal: optional(copyValue)
- };
- var publicKeyCredentialWithAssertion = {
- type: required(copyValue),
- id: required(copyValue),
- rawId: required(convertValue),
- response: required({
- clientDataJSON: required(convertValue),
- authenticatorData: required(convertValue),
- signature: required(convertValue),
- userHandle: required(convertValue)
- }),
- clientExtensionResults: derived(simplifiedClientExtensionResultsSchema, (pkc) => pkc.getClientExtensionResults())
- };
- var schema = {
- credentialCreationOptions,
- publicKeyCredentialWithAttestation,
- credentialRequestOptions,
- publicKeyCredentialWithAssertion
- };
-
- // src/webauthn-json/basic/api.ts
- function createRequestFromJSON(requestJSON) {
- var requestFromJSON = convert(base64urlToBuffer, credentialCreationOptions, requestJSON);
- console.log("Create request JSON", requestFromJSON);
- return requestFromJSON;
- }
- function createResponseToJSON(credential) {
- return convert(bufferToBase64url, publicKeyCredentialWithAttestation, credential);
- }
- async function create(requestJSON) {
- const credential = await navigator.credentials.create(createRequestFromJSON(requestJSON));
- return createResponseToJSON(credential);
- }
- function getRequestFromJSON(requestJSON) {
- return convert(base64urlToBuffer, credentialRequestOptions, requestJSON);
- }
- function getResponseToJSON(credential) {
- return convert(bufferToBase64url, publicKeyCredentialWithAssertion, credential);
- }
- async function get(requestJSON) {
- const credential = await navigator.credentials.get(getRequestFromJSON(requestJSON));
- return getResponseToJSON(credential);
- }
-
- // src/webauthn-json/basic/supported.ts
- function supported() {
- return !!(navigator.credentials && navigator.credentials.create && navigator.credentials.get && window.PublicKeyCredential);
- }
-// export {
-// create,
-// get,
-// schema,
-// supported
-// };
- //# sourceMappingURL=webauthn-json.js.map
-
\ No newline at end of file
diff --git a/resources/javascript/webauthn-shib.js b/resources/javascript/webauthn-shib.js
deleted file mode 100644
index 3f39300..0000000
--- a/resources/javascript/webauthn-shib.js
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-const base64abc = [
- "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
- "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
- "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
- "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/"
-];
-
-
-const base64codes = [
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 0, 255, 255,
- 255, 0, 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, 255, 255, 255, 255, 255,
- 255, 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
-];
-
-function bytesToBase64(bytes) {
- let result = '', i, l = bytes.length;
- for (i = 2; i < l; i += 3) {
- result += base64abc[bytes[i - 2] >> 2];
- result += base64abc[((bytes[i - 2] & 0x03) << 4) | (bytes[i - 1] >> 4)];
- result += base64abc[((bytes[i - 1] & 0x0F) << 2) | (bytes[i] >> 6)];
- result += base64abc[bytes[i] & 0x3F];
- }
- if (i === l + 1) { // 1 octet yet to write
- result += base64abc[bytes[i - 2] >> 2];
- result += base64abc[(bytes[i - 2] & 0x03) << 4];
- result += "==";
- }
- if (i === l) { // 2 octets yet to write
- result += base64abc[bytes[i - 2] >> 2];
- result += base64abc[((bytes[i - 2] & 0x03) << 4) | (bytes[i - 1] >> 4)];
- result += base64abc[(bytes[i - 1] & 0x0F) << 2];
- result += "=";
- }
- return result;
-}
-
-function responseToObject(response) {
- if (response.u2fResponse) {
- return response;
- } else {
- let clientExtensionResults = {};
-
- try {
- clientExtensionResults = response.getClientExtensionResults();
- } catch (e) {
- console.error('getClientExtensionResults failed', e);
- }
-
- if (response.response.attestationObject) {
- return {
- type: response.type,
- id: response.id,
- response: {
- attestationObject: Base64EncodeUrl(bytesToBase64(ensureUint8Array(response.response.attestationObject))),
- clientDataJSON: Base64EncodeUrl(bytesToBase64(ensureUint8Array(response.response.clientDataJSON))),
- },
- clientExtensionResults,
- };
- } else {
- return {
- type: response.type,
- id: response.id,
- response: {
- authenticatorData: Base64EncodeUrl(bytesToBase64(ensureUint8Array(response.response.authenticatorData))),
- clientDataJSON: Base64EncodeUrl(bytesToBase64(ensureUint8Array(response.response.clientDataJSON))),
- signature: Base64EncodeUrl(bytesToBase64(ensureUint8Array(response.response.signature))),
- userHandle: response.response.userHandle && Base64EncodeUrl(bytesToBase64(ensureUint8Array(response.response.userHandle))),
- },
- clientExtensionResults,
- };
- }
- }
-}
-
-if (!window.PublicKeyCredential) {
- console.log("Bad client, died");
-}
-
-function ensureUint8Array(arg) {
- if (arg instanceof ArrayBuffer) {
- return new Uint8Array(arg);
- } else {
- return arg;
- }
-}
-/**
- * use this to make a Base64 encoded string URL friendly,
- * i.e. '+' and '/' are replaced with '-' and '_' also any trailing '='
- * characters are removed
- *
- * @param {String} str the encoded string
- * @returns {String} the URL friendly encoded String
- */
-function Base64EncodeUrl(str) {
- return str.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=+$/, '');
-}
-
- function extend(obj, more) {
- return Object.assign({}, obj, more);
- }
-
- /**
- * Create a WebAuthn credential.
- *
- * @param request: object - A PublicKeyCredentialCreationOptions object, except
- * where binary values are base64url encoded strings instead of byte arrays
- *
- * @return a PublicKeyCredentialCreationOptions suitable for passing as the
- * `publicKey` parameter to `navigator.credentials.create()`
- */
- function decodePublicKeyCredentialCreationOptions(request) {
- // const excludeCredentials = request.excludeCredentials.map(credential => extend(
- // credential, {
- // id: base64url.toByteArray(credential.id),
- // }));
-
- const publicKeyCredentialCreationOptions = extend(
- request, {
- attestation: 'direct',
- user: extend(
- request.user, {
- id: Uint8Array.from(request.user.id, c => c.charCodeAt(0)),
- }),
- challenge: Uint8Array.from(request.challenge, c => c.charCodeAt(0)),
- //excludeCredentials,
- });
-
- return publicKeyCredentialCreationOptions;
- }
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list