[java-idp-plugin-webauthn] branch main updated: Add retry button to authentication

Phil Smart philip.smart at jisc.ac.uk
Tue Jan 30 12:47:30 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=0f8610add24b05d256d8ebf125f137f47c03be7e

The following commit(s) were added to refs/heads/main by this push:
     new 0f8610a  Add retry button to authentication
0f8610a is described below

commit 0f8610add24b05d256d8ebf125f137f47c03be7e
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Jan 30 13:47:28 2024 +0100

    Add retry button to authentication
---
 .../plugin/authn/webauthn/views/webauthn-authn.vm  | 55 ++++++++++++----------
 1 file changed, 30 insertions(+), 25 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 9544730..cba1916 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
@@ -44,6 +44,7 @@
             // 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
             }
@@ -60,17 +61,12 @@
                     document.getElementById("authenticationSubmit").click();
                 }).catch(function (err) { 
                     console.error(err);
-                    document.getElementById('authnProgress').classList.add('hidden')                
+                    document.getElementById('authnProgress').classList.add('hidden')     
+                    document.getElementById('authnFailed').classList.remove('hidden')            
                 });
 
         }
 
-        function initButton() {
-            document.getElementById("authenticate").onclick = authenticate;
-            return false;
-        }
-
-
         window.addEventListener("load", () => {
             try {
                 var isSupported = supported();
@@ -85,9 +81,11 @@
                     document.getElementById('unsupportedDiv').classList.remove('hidden')
                 } else {
                     #if($debug == "true")
-                    initButton();
+                        document.getElementById("authenticate").onclick = authenticate;
+                        document.getElementById("retry").onclick = authenticate;
                     #else
-                    authenticate();
+                        document.getElementById("retry").onclick = authenticate;
+                        authenticate();
                     #end
                 }
 
@@ -145,23 +143,30 @@
                         <div id="authnProgress" class="hidden centre">
                             #springMessageText("idp.webauthn.authn.progress.message","Authenticating...")
                         </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 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
                     </div>
                 </div>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list