[java-idp-plugin-webauthn] branch main updated: Some view cleanups
Phil Smart
philip.smart at jisc.ac.uk
Wed Feb 7 11:43:01 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=0aff315cd178c4fb38d1d7def8f790df2f8f3fe6
The following commit(s) were added to refs/heads/main by this push:
new 0aff315 Some view cleanups
0aff315 is described below
commit 0aff315cd178c4fb38d1d7def8f790df2f8f3fe6
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Feb 7 11:42:57 2024 +0000
Some view cleanups
---
.../plugin/authn/webauthn/views/webauthn-authn.vm | 294 ++++++++++-----------
.../authn/webauthn/views/webauthn-register.vm | 283 ++++++++++----------
.../authn/webauthn/views/webauthn-registered.vm | 132 +++++----
.../authn/webauthn/views/webauthn-selector.vm | 13 +-
4 files changed, 337 insertions(+), 385 deletions(-)
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn.vm
index 062db51..4ae2d6a 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn.vm
@@ -23,167 +23,145 @@
<!DOCTYPE html>
<html>
-<head>
- <title>#springMessageText("idp.title", "Web Login Service")</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">
- <script type="text/javascript" src="$request.getContextPath()/js/webauthn/webauthn-support.js"></script>
- <link rel="stylesheet" type="text/css" href="$request.getContextPath()#springMessageText("
- idp.css", "/css/placeholder.css" )">
- <link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/webauthn.css">
- <script type="module">
-
- import {
- get,
- parseRequestOptionsFromJSON,
- supported,
- } from "$request.getContextPath()/js/webauthn/webauthn-json.browser-ponyfill.js";
-
- async function authenticate() {
- // Some UI changes
- try {
- document.getElementById('authnProgress').classList.remove('hidden')
- document.getElementById('authnFailed').classList.add('hidden')
- } catch (e) {
- // No issue if this does not work
- }
-
- var pkCredRequestOptions = $webauthnContext.publicKeyCredentialRequestOptionsJSON;
- var parsedRequestOptions = parseRequestOptionsFromJSON({ publicKey: pkCredRequestOptions });
- #if($debug == "true")
- console.log("Raw request options", pkCredRequestOptions);
- console.log("Parsed request options", parsedRequestOptions);
- #end
- await get(parsedRequestOptions)
- .then(function (assertion) {
- document.getElementById("publicKeyAssertion").value = JSON.stringify(assertion);
- document.getElementById("authenticationSubmit").click();
- }).catch(function (err) {
- console.error(err);
- document.getElementById('authnProgress').classList.add('hidden')
- document.getElementById('authnFailed').classList.remove('hidden')
- });
-
- }
-
- window.addEventListener("load", () => {
- try {
- var isSupported = supported();
- if (!isSupported) {
- document.getElementById('supportedDiv').classList.add('hidden')
- document.getElementById("supportedDiv").disabled = true;
- document.getElementById("authenticate").disabled = true;
- document.getElementById("authenticatorAssertionForm").disabled = true;
- document.getElementById("authenticationSubmit").disabled = true;
-
- document.getElementById("unsupportedDiv").disabled = false;
- document.getElementById('unsupportedDiv').classList.remove('hidden')
- } else {
- #if($debug == "true")
+ <head>
+ <title>#springMessageText("idp.title", "Web Login Service")</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">
+ <script type="text/javascript" src="$request.getContextPath()/js/webauthn/webauthn-support.js"></script>
+ <link rel="stylesheet" type="text/css" href="$request.getContextPath()#springMessageText("
+ idp.css", "/css/placeholder.css" )">
+ <link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/webauthn.css">
+ <script type="module">
+
+ import {
+ get,
+ parseRequestOptionsFromJSON,
+ supported,
+ } from "$request.getContextPath()/js/webauthn/webauthn-json.browser-ponyfill.js";
+
+ async function authenticate() {
+ // Some UI changes
+ try {
+ document.getElementById('authenticate').textContent='#springMessageText("idp.webauthn.authn.authenticate",
+ "Authenticating...")'
+ } catch (e) {
+ // No issue if this does not work
+ }
+ var pkCredRequestOptions = $webauthnContext.publicKeyCredentialRequestOptionsJSON;
+ var parsedRequestOptions = parseRequestOptionsFromJSON({ publicKey: pkCredRequestOptions });
+ #if($debug == "true")
+ console.log("Raw request options", pkCredRequestOptions);
+ console.log("Parsed request options", parsedRequestOptions);
+ #end
+ await get(parsedRequestOptions)
+ .then(function (assertion) {
+ document.getElementById("publicKeyAssertion").value = JSON.stringify(assertion);
+ document.getElementById("authenticationSubmit").click();
+ }).catch(function (err) {
+ console.error(err);
+ document.getElementById('authenticate').textContent='#springMessageText("idp.webauthn.authn.authenticate.retry",
+ "Authentication failed, retry")'
+ });
+ }
+ window.addEventListener("load", () => {
+ try {
+ var isSupported = supported();
+ if (!isSupported) {
+ document.getElementById('supportedDiv').classList.add('hidden')
+ document.getElementById("supportedDiv").disabled = true;
+ document.getElementById("authenticate").disabled = true;
+ document.getElementById("authenticatorAssertionForm").disabled = true;
+ document.getElementById("authenticationSubmit").disabled = true;
+ document.getElementById("unsupportedDiv").disabled = false;
+ document.getElementById('unsupportedDiv').classList.remove('hidden')
+ } else {
document.getElementById("authenticate").onclick = authenticate;
- document.getElementById("retry").onclick = authenticate;
- #else
- document.getElementById("retry").onclick = authenticate;
- authenticate();
- #end
+ #if($debug == "false")
+ authenticate();
+ #end
+ }
+ } catch (e) {
+ console.error(e);
}
-
- } catch (e) {
- console.error(e);
- }
- });
-
- </script>
-</head>
-
-<body>
- <main class="main">
- <header>
- <img class="main-logo" src="$request.getContextPath()#springMessageText("
- idp.logo", "/images/placeholder-logo.png" )" alt="#springMessageText(" idp.logo.alt-text", "logo" )" />
-
- #set ($serviceName = $rpUIContext.serviceName)
- #if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
- <h1>#springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)</h1>
- #end
- </header>
-
- <section>
- #*
- //
- // SP Description & Logo (optional)
- // These idpui lines will display added information (if available
- // in the metadata) about the Service Provider (SP) that requested
- // authentication. These idpui lines are "active" in this example
- // (not commented out) - this extra SP info will be displayed.
- // Remove or comment out these lines to stop the display of the
- // added SP information.
- //
- *#
- #set ($logo = $rpUIContext.getLogo())
- #if ($logo)
- <img class="service-logo" src="$encoder.encodeForHTMLAttribute($logo)"
- alt="$encoder.encodeForHTMLAttribute($serviceName)">
- #end
- #set ($desc = $rpUIContext.getServiceDescription())
- #if ($desc)
- <p>$encoder.encodeForHTML($desc)</p>
- #end
- <div id="supportedDiv">
- <div class="content">
- <div class="column one">
- <form id="authenticatorAssertionForm" action="$flowExecutionUrl" method="post">
- #parse("csrf/csrf.vm")
- <input type="hidden" id="publicKeyAssertion" name="publicKeyAssertion" />
- <button class="hidden" id="authenticationSubmit" type="submit"
- name="_eventId_proceed">#springMessageText("idp.webauthn.authn.submit", "Submit
- Authentication")</button>
- </form>
- <div id="authnProgress" class="hidden centre">
- #springMessageText("idp.webauthn.authn.progress.message","Authenticating...")
- </div>
- <div id="authnFailed" class="hidden centre">
- #springMessageText("idp.webauthn.authn.failed.message","Authentication cancelled")
- <br/>
- <button id="retry"
- class="form-element form-button">#springMessageText("idp.webauthn.authn.retry.authenticate",
- "Retry")</button>
- </div>
- #if($debug == "true")
- <div class="centre">
- <button id="authenticate"
- class="form-element form-button">#springMessageText("idp.webauthn.authn.authenticate",
- "Authenticate")</button>
- </div>
- <hr />
- <button type="button" class="collapsible">#springMessageText("idp.webauthn.debug.title",
- "Debugging")</button>
+ });
- <div class="debug" id="debug-div">
- <label for="publicKeyCredentialCreation">#springMessageText("idp.webauthn.debug.request",
- "Request Options")</label>
- <textarea id="publicKeyCredentialRequestOptions" name="publicKeyCredentialRequestOptions"
- rows="20" cols="50">
- $webauthnContext.publicKeyCredentialRequestOptionsJSON</textarea>
- </div>
- #end
+ </script>
+ </head>
+ <body>
+ <main class="main">
+ <header>
+ <img class="main-logo" src="$request.getContextPath()#springMessageText("
+ idp.logo", "/images/placeholder-logo.png" )" alt="#springMessageText(" idp.logo.alt-text", "logo" )" />
+
+ #set ($serviceName = $rpUIContext.serviceName)
+ #if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
+ <h1>#springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)</h1>
+ #end
+ </header>
+
+ <section>
+ #*
+ //
+ // SP Description & Logo (optional)
+ // These idpui lines will display added information (if available
+ // in the metadata) about the Service Provider (SP) that requested
+ // authentication. These idpui lines are "active" in this example
+ // (not commented out) - this extra SP info will be displayed.
+ // Remove or comment out these lines to stop the display of the
+ // added SP information.
+ //
+ *#
+ #set ($logo = $rpUIContext.getLogo())
+ #if ($logo)
+ <img class="service-logo" src="$encoder.encodeForHTMLAttribute($logo)"
+ alt="$encoder.encodeForHTMLAttribute($serviceName)">
+ #end
+ #set ($desc = $rpUIContext.getServiceDescription())
+ #if ($desc)
+ <p>$encoder.encodeForHTML($desc)</p>
+ #end
+ <div id="supportedDiv">
+ <div class="content">
+ <div class="column one">
+ <form id="authenticatorAssertionForm" action="$flowExecutionUrl" method="post">
+ #parse("csrf/csrf.vm")
+ <input type="hidden" id="publicKeyAssertion" name="publicKeyAssertion" />
+ <button class="hidden" id="authenticationSubmit" type="submit"
+ name="_eventId_proceed">#springMessageText("idp.webauthn.authn.submit", "Submit
+ Authentication")</button>
+ </form>
+ <div class="centre">
+ <button id="authenticate"
+ class="form-element form-button">#springMessageText("idp.webauthn.authn.authenticate",
+ "Authenticate")</button>
+ </div>
+ #if($debug == "true")
+ <hr />
+ <button type="button" class="collapsible">#springMessageText("idp.webauthn.debug.title",
+ "Debugging")</button>
+ <div class="debug" id="debug-div">
+ <label for="publicKeyCredentialCreation">#springMessageText("idp.webauthn.debug.request",
+ "Request Options")</label>
+ <textarea id="publicKeyCredentialRequestOptions" name="publicKeyCredentialRequestOptions"
+ rows="20" cols="50">
+ $webauthnContext.publicKeyCredentialRequestOptionsJSON</textarea>
+ </div>
+ #end
+ </div>
</div>
</div>
- </div>
- </div>
- <div id="unsupportedDiv" class="hidden">
- #springMessageText("idp.webauthn.authn.unsupported", "Your browser is not WebAuthn compatible")
- </div>
- </section>
-
- <footer>
- <div class="container container-footer">
- <p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p>
- </div>
- </footer>
- </div>
-
-</body>
-
+ </div>
+ <div id="unsupportedDiv" class="hidden">
+ #springMessageText("idp.webauthn.authn.unsupported", "Your browser is not WebAuthn compatible")
+ </div>
+ </section>
+
+ <footer>
+ <div class="container container-footer">
+ <p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p>
+ </div>
+ </footer>
+ </div>
+ </body>
</html>
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
index 2f27c14..97aa4e9 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register.vm
@@ -24,156 +24,145 @@
<!DOCTYPE html>
<html>
-<head>
- <title>#springMessageText("idp.title", "Web Login Service")</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">
- <script type="text/javascript" src="$request.getContextPath()/js/webauthn/webauthn-support.js"></script>
- <link rel="stylesheet" type="text/css" href="$request.getContextPath()#springMessageText("idp.css", "/css/placeholder.css" )">
- <link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/webauthn.css">
- <script type="module">
-
- import {
- parseCreationOptionsFromJSON,
- create,
- supported,
- } from "$request.getContextPath()/js/webauthn/webauthn-json.browser-ponyfill.js";
-
- async function register() {
- var pkCredOptions = $webauthnRegContext.publicKeyCredentialCreationOptionsJSON;
- var pkCredOptionsParsed = parseCreationOptionsFromJSON({ publicKey: pkCredOptions });
- #if($debug == "true")
- console.log("Raw creation options", pkCredOptions);
- console.log("Parsed creation options", pkCredOptionsParsed);
- #end
- await create(pkCredOptionsParsed)
- .then(function (attestation){
- var nickname = prompt("Credential Nickname");
- document.getElementById("credentialNickname").value = nickname;
- document.getElementById("authenticatorAttestation").value = JSON.stringify(attestation);
- document.getElementById("registrationSubmit").click();
- }).catch(function (err){
- console.error(err)
- });
-
- };
-
- function initButton() {
- document.getElementById("registerButton").onclick = register;
- return false;
- }
-
- window.addEventListener("load", () => {
- try {
- var isSupported = supported();
- if (!isSupported){
- document.getElementById('supportedDiv').classList.add('hidden')
- document.getElementById("supportedDiv").disabled = true;
- document.getElementById("authenticatorAttestationForm").disabled = true;
- document.getElementById("registrationSubmit").disabled = true;
+ <head>
+ <title>#springMessageText("idp.title", "Web Login Service")</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">
+ <script type="text/javascript" src="$request.getContextPath()/js/webauthn/webauthn-support.js"></script>
+ <link rel="stylesheet" type="text/css" href="$request.getContextPath()#springMessageText("idp.css", "/css/placeholder.css" )">
+ <link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/webauthn.css">
+ <script type="module">
+
+ import {
+ parseCreationOptionsFromJSON,
+ create,
+ supported,
+ } from "$request.getContextPath()/js/webauthn/webauthn-json.browser-ponyfill.js";
+
+ async function register() {
+ var pkCredOptions = $webauthnRegContext.publicKeyCredentialCreationOptionsJSON;
+ var pkCredOptionsParsed = parseCreationOptionsFromJSON({ publicKey: pkCredOptions });
+ #if($debug == "true")
+ console.log("Raw creation options", pkCredOptions);
+ console.log("Parsed creation options", pkCredOptionsParsed);
+ #end
+ await create(pkCredOptionsParsed)
+ .then(function (attestation){
+ var nickname = prompt("Credential Nickname");
+ document.getElementById("credentialNickname").value = nickname;
+ document.getElementById("authenticatorAttestation").value = JSON.stringify(attestation);
+ document.getElementById("registrationSubmit").click();
+ }).catch(function (err){
+ console.error(err)
+ });
- document.getElementById("unsupportedDiv").disabled = false;
- document.getElementById('unsupportedDiv').classList.remove('hidden')
- } else{
- initButton();
- }
-
- } catch (e) {
- console.error(e);
- }
-});
-
-</script>
-
-</head>
-
-<body>
-
- <main class="main">
- <header>
- <img class="main-logo" src="$request.getContextPath()#springMessageText(" idp.logo", "/images/placeholder-logo.png" )" alt="#springMessageText(" idp.logo.alt-text", "logo" )" />
- #set ($serviceName = $rpUIContext.serviceName)
- #if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
- <h1>#springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)</h1>
- #end
- </header>
-
- <section>
- <div id="supportedDiv">
- <div class="content">
- <div class="column one centre">
- <div>
- <h1>Registered Keys</h1>
- #if ($webauthnRegContext.existingCredentials)
- <table>
- <tr>
- <th>#springMessageText("idp.webauthn.register.table.keyName", "Key Name")</th>
- <th>#springMessageText("idp.webauthn.register.table.transports", "Transports")</th>
- <th>#springMessageText("idp.webauthn.register.table.passkey", "Passkey?")</th>
- <th>#springMessageText("idp.webauthn.register.table.registrationTime", "Registration Time")</th>
- <th>#springMessageText("idp.webauthn.register.table.action", "Action")</th>
- </tr>
- #foreach($cred in $webauthnRegContext.existingCredentials)
+ };
+
+ function initButton() {
+ document.getElementById("registerButton").onclick = register;
+ return false;
+ }
+
+ window.addEventListener("load", () => {
+ try {
+ var isSupported = supported();
+ if (!isSupported){
+ document.getElementById('supportedDiv').classList.add('hidden')
+ document.getElementById("supportedDiv").disabled = true;
+ document.getElementById("authenticatorAttestationForm").disabled = true;
+ document.getElementById("registrationSubmit").disabled = true;
+
+ document.getElementById("unsupportedDiv").disabled = false;
+ document.getElementById('unsupportedDiv').classList.remove('hidden')
+ } else{
+ initButton();
+ }
+
+ } catch (e) {
+ console.error(e);
+ }
+ });
+ </script>
+ </head>
+ <body>
+ <main class="main">
+ <header>
+ <img class="main-logo" src="$request.getContextPath()#springMessageText(" idp.logo", "/images/placeholder-logo.png" )" alt="#springMessageText(" idp.logo.alt-text", "logo" )" />
+ #set ($serviceName = $rpUIContext.serviceName)
+ #if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
+ <h1>#springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)</h1>
+ #end
+ </header>
+ <section>
+ <div id="supportedDiv">
+ <div class="content">
+ <div class="column one centre">
+ <div>
+ <h1>Registered Keys</h1>
+ #if ($webauthnRegContext.existingCredentials)
+ <table>
<tr>
- <td>$encoder.encodeForHTML($cred.nickname)</td>
- <td>$encoder.encodeForHTML($webAuthnEncoder.formatTransports($cred.transports))</td>
- <td>$encoder.encodeForHTML($webAuthnEncoder.formatDiscoverable($cred.isDiscoverable()))</td>
- <td>$encoder.encodeForHTML($webAuthnEncoder.formatInstant($cred.registrationTime))</td>
- <td>
- <form id="deleteKeyForm" action="$flowExecutionUrl" method="post">
- #parse("csrf/csrf.vm")
- <input type="hidden" name="credentialId" value="$cred.credentialIdBase64Url"/>
- <button class="webauthn-table-button" id="removeButton" type="submit" name="_eventId_deleteKey">#springMessageText("idp.webauthn.register.credential.remove", "Remove")</button>
- </form>
- </td>
+ <th>#springMessageText("idp.webauthn.register.table.keyName", "Key Name")</th>
+ <th>#springMessageText("idp.webauthn.register.table.transports", "Transports")</th>
+ <th>#springMessageText("idp.webauthn.register.table.passkey", "Passkey?")</th>
+ <th>#springMessageText("idp.webauthn.register.table.registrationTime", "Registration Time")</th>
+ <th>#springMessageText("idp.webauthn.register.table.action", "Action")</th>
</tr>
- #end
- </table>
- #else
- <div><span>#springMessageText("idp.webauthn.register.registered.noKeys", "You have no registered keys")</span></div>
- #end
- <br/>
- <div>
- <button class="form-element form-button" id="registerButton">#springMessageText("idp.webauthn.register.addKey", "Add New Security Key")</button>
- </div>
-
- <form id="authenticatorAttestationForm" action="$flowExecutionUrl" method="post">
- #parse("csrf/csrf.vm")
- <input type="hidden" id="credentialNickname" name="credentialNickname"/>
- <input type="hidden" id="authenticatorAttestation" name="authenticatorAttestation"/>
- <button class="hidden" id="registrationSubmit" type="submit" name="_eventId_addKey">#springMessageText("idp.webauthn.register.submit", "Submit Registration")</button>
- </form>
- </div>
-
- #if($debug == "true")
- <hr/>
-
- <button type="button" class="collapsible">#springMessageText("idp.webauthn.register.debug.title", "Debugging")</button>
-
- <div class="debug" id="debug-div">
- <label for="publicKeyCredentialCreation">#springMessageText("idp.webauthn.register.debug.registration", "Registration Options")</label>
- <textarea id="publicKeyCredentialCreation" name="publicKeyCredentialCreation" rows="20" cols="50">
- $webauthnRegContext.publicKeyCredentialCreationOptionsJSON</textarea>
- </div>
- #end
-
+ #foreach($cred in $webauthnRegContext.existingCredentials)
+ <tr>
+ <td>$encoder.encodeForHTML($cred.nickname)</td>
+ <td>$encoder.encodeForHTML($webAuthnEncoder.formatTransports($cred.transports))</td>
+ <td>$encoder.encodeForHTML($webAuthnEncoder.formatDiscoverable($cred.isDiscoverable()))</td>
+ <td>$encoder.encodeForHTML($webAuthnEncoder.formatInstant($cred.registrationTime))</td>
+ <td>
+ <form id="deleteKeyForm" action="$flowExecutionUrl" method="post">
+ #parse("csrf/csrf.vm")
+ <input type="hidden" name="credentialId" value="$cred.credentialIdBase64Url"/>
+ <button class="webauthn-table-button" id="removeButton" type="submit" name="_eventId_deleteKey">#springMessageText("idp.webauthn.register.credential.remove", "Remove")</button>
+ </form>
+ </td>
+ </tr>
+ #end
+ </table>
+ #else
+ <div><span>#springMessageText("idp.webauthn.register.registered.noKeys", "You have no registered keys")</span></div>
+ #end
+ <br/>
+ <div>
+ <button class="form-element form-button" id="registerButton">#springMessageText("idp.webauthn.register.addKey", "Add New Security Key")</button>
+ </div>
+
+ <form id="authenticatorAttestationForm" action="$flowExecutionUrl" method="post">
+ #parse("csrf/csrf.vm")
+ <input type="hidden" id="credentialNickname" name="credentialNickname"/>
+ <input type="hidden" id="authenticatorAttestation" name="authenticatorAttestation"/>
+ <button class="hidden" id="registrationSubmit" type="submit" name="_eventId_addKey">#springMessageText("idp.webauthn.register.submit", "Submit Registration")</button>
+ </form>
+ </div>
+ #if($debug == "true")
+ <hr/>
+ <button type="button" class="collapsible">#springMessageText("idp.webauthn.register.debug.title", "Debugging")</button>
+
+ <div class="debug" id="debug-div">
+ <label for="publicKeyCredentialCreation">#springMessageText("idp.webauthn.register.debug.registration", "Registration Options")</label>
+ <textarea id="publicKeyCredentialCreation" name="publicKeyCredentialCreation" rows="20" cols="50">
+ $webauthnRegContext.publicKeyCredentialCreationOptionsJSON</textarea>
+ </div>
+ #end
+ </div>
</div>
- </div>
- <div id="unsupportedDiv" class="hidden">
- #springMessageText("idp.webauthn.register.unsupported", "Your browser is not WebAuthn compatible")
+ <div id="unsupportedDiv" class="hidden">
+ #springMessageText("idp.webauthn.register.unsupported", "Your browser is not WebAuthn compatible")
+ </div>
</div>
-
- </div>
- </section>
- </main>
- <footer>
- <div class="container container-footer">
- <p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p>
- </div>
- </footer>
- </div>
-
-</body>
-
+ </section>
+ </main>
+ <footer>
+ <div class="cc">
+ <p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p>
+ </div>
+ </footer>
+ </div>
+ </body>
</html>
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
index 3a06395..419012e 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-registered.vm
@@ -22,77 +22,67 @@
##
<!DOCTYPE html>
<html>
-
-<head>
- <title>#springMessageText("idp.title", "Web Login Service")</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="$request.getContextPath()#springMessageText("
- idp.css", "/css/placeholder.css" )">
- <link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/webauthn.css">
-</head>
-
-
-
-<body>
- <main class="main">
- <header>
- <img class="main-logo" src="$request.getContextPath()#springMessageText("
- idp.logo", "/images/placeholder-logo.png" )" alt="#springMessageText(" idp.logo.alt-text", "logo" )" />
-
- #set ($serviceName = $rpUIContext.serviceName)
- #if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
- <h1>#springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)</h1>
- #end
- </header>
- <section>
- <div class="centre">
- <p>$registrationOutcomes</p>
-
- <hr />
-
- #if ($webauthnRegContext.existingCredentials)
- <p>Registered Keys</p>
- <table>
- <tr>
- <th>#springMessageText("idp.webauthn.register.table.keyName", "Key Name")</th>
- <th>#springMessageText("idp.webauthn.register.table.transports", "Transports")</th>
- <th>#springMessageText("idp.webauthn.register.table.passkey", "Passkey?")</th>
- <th>#springMessageText("idp.webauthn.register.table.userVerifiedOnRegistration", "User Verified?")</th>
- <th>#springMessageText("idp.webauthn.register.table.registrationTime", "Registration Time")</th>
- </tr>
- #foreach($cred in $webauthnRegContext.existingCredentials)
- <tr>
- <td>$encoder.encodeForHTML($cred.nickname)</td>
- <td>$encoder.encodeForHTML($webAuthnEncoder.formatTransports($cred.transports))</td>
- <td>$encoder.encodeForHTML($webAuthnEncoder.formatDiscoverable($cred.isDiscoverable()))</td>
- <td>$encoder.encodeForHTML($cred.userVerified)</td>
- <td>$encoder.encodeForHTML($webAuthnEncoder.formatInstant($cred.registrationTime))</td>
- </tr>
- #end
- </table>
- #else
- <div><span>You have no registered keys</span></div>
+ <head>
+ <title>#springMessageText("idp.title", "Web Login Service")</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="$request.getContextPath()#springMessageText("
+ idp.css", "/css/placeholder.css" )">
+ <link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/webauthn.css">
+ </head>
+ <body>
+ <main class="main">
+ <header>
+ <img class="main-logo" src="$request.getContextPath()#springMessageText("
+ idp.logo", "/images/placeholder-logo.png" )" alt="#springMessageText(" idp.logo.alt-text", "logo" )" />
+
+ #set ($serviceName = $rpUIContext.serviceName)
+ #if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
+ <h1>#springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)</h1>
#end
- <br />
- <form id="finish_button_form" action="$flowExecutionUrl" method="post">
- #parse("csrf/csrf.vm")
- <button id="finish_button" type="submit" name="_eventId_proceed">#springMessageText("idp.webauthn.register.finish", "Done")</button>
- </form>
+ </header>
+ <section>
+ <div class="centre">
+ <p>$registrationOutcomes</p>
+
+ <hr />
+
+ #if ($webauthnRegContext.existingCredentials)
+ <p>Registered Keys</p>
+ <table>
+ <tr>
+ <th>#springMessageText("idp.webauthn.register.table.keyName", "Key Name")</th>
+ <th>#springMessageText("idp.webauthn.register.table.transports", "Transports")</th>
+ <th>#springMessageText("idp.webauthn.register.table.passkey", "Passkey?")</th>
+ <th>#springMessageText("idp.webauthn.register.table.userVerifiedOnRegistration", "User Verified?")</th>
+ <th>#springMessageText("idp.webauthn.register.table.registrationTime", "Registration Time")</th>
+ </tr>
+ #foreach($cred in $webauthnRegContext.existingCredentials)
+ <tr>
+ <td>$encoder.encodeForHTML($cred.nickname)</td>
+ <td>$encoder.encodeForHTML($webAuthnEncoder.formatTransports($cred.transports))</td>
+ <td>$encoder.encodeForHTML($webAuthnEncoder.formatDiscoverable($cred.isDiscoverable()))</td>
+ <td>$encoder.encodeForHTML($cred.userVerified)</td>
+ <td>$encoder.encodeForHTML($webAuthnEncoder.formatInstant($cred.registrationTime))</td>
+ </tr>
+ #end
+ </table>
+ #else
+ <div><span>You have no registered keys</span></div>
+ #end
+ <br />
+ <form id="finish_button_form" action="$flowExecutionUrl" method="post">
+ #parse("csrf/csrf.vm")
+ <button id="finish_button" type="submit" name="_eventId_proceed">#springMessageText("idp.webauthn.register.finish", "Done")</button>
+ </form>
+ </div>
+ </section>
+ </main>
+ <footer>
+ <div class="cc">
+ <p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p>
</div>
-
-
- </section>
- </main>
-
- <footer>
- <div class="container container-footer">
- <p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p>
- </div>
- </footer>
- </div>
-
-</body>
-
+ </footer>
+ </body>
</html>
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-selector.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-selector.vm
index c793c26..d9d9150 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-selector.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-selector.vm
@@ -32,10 +32,8 @@
#if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
<h1>#springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)</h1>
#end
- </header>
-
- <section>
-
+ </header>
+ <section>
<form action="$flowExecutionUrl" method="post">
#parse("csrf/csrf.vm")
<div class="grid">
@@ -51,16 +49,13 @@
<button type="submit" name="_eventId_password">Use Password</button>
</div>
</div>
- </form>
-
+ </form>
</section>
</main>
<footer class="footer">
<div class="cc">
<p>#springMessageText("idp.footer", "Insert your footer text here.")</p>
</div>
- </footer>
- </body>
-
+ </footer>
</body>
</html>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list