[java-idp-plugin-webauthn] branch main updated: Add messages.properties to bean file and extend IDP message sources

Phil Smart philip.smart at jisc.ac.uk
Fri Apr 19 08:47:24 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=c7675966d8987a5ca59b139bd6a6418aebf20588

The following commit(s) were added to refs/heads/main by this push:
     new c767596  Add messages.properties to bean file and extend IDP message sources
c767596 is described below

commit c7675966d8987a5ca59b139bd6a6418aebf20588
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Apr 19 09:47:21 2024 +0100

    Add messages.properties to bean file and extend IDP message sources
---
 .../authn/WebAuthn/webauthn-abstract-beans.xml     | 17 +++++++++
 .../idp/plugin/authn/webauthn/messages.properties  | 43 ++++++++++++++++++++++
 .../webauthn/views/webauthn-authn-username.vm      |  1 +
 .../plugin/authn/webauthn/views/webauthn-authn.vm  |  5 +--
 .../webauthn/views/webauthn-register-username.vm   |  4 --
 .../authn/webauthn/views/webauthn-register.vm      |  2 +-
 6 files changed, 64 insertions(+), 8 deletions(-)

diff --git a/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/WebAuthn/webauthn-abstract-beans.xml b/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/WebAuthn/webauthn-abstract-beans.xml
index 745baf1..d500b4b 100644
--- a/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/WebAuthn/webauthn-abstract-beans.xml
+++ b/webauthn-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/authn/WebAuthn/webauthn-abstract-beans.xml
@@ -8,6 +8,23 @@
                            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
 
     default-init-method="initialize" default-destroy-method="destroy">
+    
+    <!-- Message properties -->
+    
+    <!-- This extends the original user-space resource list with the plugin-embedded messages. -->
+    <bean id ="ExtendedMessageSourceResources" parent="shibboleth.ListCombiner"
+          p:firstList-ref="#{'%{idp.message.resources:shibboleth.MessageSourceResources}'.trim()}" >
+        <property name="secondList">
+            <util:list >
+                <value>classpath:/net/shibboleth/idp/plugin/authn/webauthn/messages</value>
+            </util:list>
+        </property>
+    </bean>
+
+    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
+        p:cacheSeconds="%{idp.message.cacheSeconds:300}"
+        p:basenames-ref="ExtendedMessageSourceResources"
+        p:defaultEncoding="UTF-8" />
 
     <!-- Abstract parent beans -->        
       
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/messages.properties b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/messages.properties
new file mode 100644
index 0000000..52e4efe
--- /dev/null
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/messages.properties
@@ -0,0 +1,43 @@
+# In addition to the Apache 2.0 license, this content is also licensed
+# under the Creative Commons Attribution-ShareAlike 3.0 Unported license
+# (see http://creativecommons.org/licenses/by-sa/3.0/). 
+
+# This is the as-delivered set of messages used in various views
+# so that internationalized translations can be made available and
+# so administrators can locally override or supplement the values
+# in their own message files.
+
+
+idp.webauthn.authn.authenticate.inprogress = Authenticating...
+idp.webauthn.authn.authenticate.retry = Login failed, retry
+idp.webauthn.authn.authenticate.submit = Submit Authentication
+idp.webauthn.authn.authenticate = Login with passkey or security key
+
+idp.webauthn.authn.unsupported = Your browser is not WebAuthn compatible
+
+idp.webauthn.passwordless.explain = If you've enrolled a passkey or device/token for passwordless login, please enter your username below and press the corresponding button.
+
+idp.webauthn.enrollment.url = /idp/profile/admin/webauthn-registration
+
+idp.webauthn.register.credential.nickanme = Credential Nickname
+idp.webauthn.register.credential.remove.confirm = Are you sure
+idp.webauthn.register.table.header.keyName = Key Name
+idp.webauthn.register.table.header.authenticatorDescription = Authenticator
+idp.webauthn.register.table.header.transports = Transports
+idp.webauthn.register.table.header.passkey = Passkey?
+idp.webauthn.register.table.header.registrationTime = Registration Time
+idp.webauthn.register.table.header.action = Action
+idp.webauthn.register.table.unknownCredential = unknown
+idp.webauthn.register.credential.remove = Remove
+idp.webauthn.register.registered.noKeys = You have no registered keys
+idp.webauthn.register.addKey = Add New Security Key
+idp.webauthn.register.finish = Finish
+idp.webauthn.register.submit = Submit Registration
+idp.webauthn.register.username.explain = Please enter your username below and press the corresponding button.
+idp.webauthn.register.username.proceed = Next
+
+
+# When debug information has been enabled
+idp.webauthn.debug.title = Debugging
+idp.webauthn.debug.request = Request Options
+idp.webauthn.register.debug.registration = Registration Options
\ No newline at end of file
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn-username.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn-username.vm
index 47bd8d6..f898d35 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn-username.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-authn-username.vm
@@ -24,6 +24,7 @@
 #end
 #set ($nonce = $cspNonce.generateIdentifier())
 $response.addHeader("Content-Security-Policy", "script-src-elem 'nonce-$nonce'")
+## TODO fix this
 #set ($onClick = "document.forms.password.j_username.value = document.forms.passwordless.j_username.value")
 ### TODO ADD THIS BACK
 ###$response.addHeader("Content-Security-Policy", "script-src-attr 'unsafe-hashes' 'sha256-$cspDigester.apply($onClick)'")
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 3d9c1b7..2ea24b2 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
@@ -86,8 +86,7 @@
     <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" )" />
+            <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>
@@ -120,7 +119,7 @@
                         #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
+                            name="_eventId_proceed">#springMessageText("idp.webauthn.authn.authenticate.submit", "Submit
                         Authentication")</button>
                     </form>
                     <div class="centre">
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register-username.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register-username.vm
index 57e24d7..cd1e9cf 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register-username.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register-username.vm
@@ -44,10 +44,6 @@ $response.addHeader("Content-Security-Policy", "script-src-elem 'nonce-$nonce'")
             <section>  
                 <blockquote>#springMessageText("idp.webauthn.register.username.explain", "Please enter your username below and press the corresponding button.")</blockquote>
 
-                #if ($eventId == "RequestUnsupported")
-                    <p class="output-message output--error">$encoder.encodeForHTML("#springMessageText('idp.duo.passwordless.unsupported', 'You have not enrolled a qualifying device for Passwordless use.')")</p>
-                #end
-                        
                 <form name="username-entry" action="$flowExecutionUrl" method="post">
                     #parse("csrf/csrf.vm")
                     
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 7172575..6f93cde 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
@@ -102,7 +102,7 @@
    <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" )" />
+            <img class="main-logo" src="$request.getContextPath()#springMessageText("idp.logo", "/images/placeholder-logo.png" )" alt="#springMessageText(" idp.logo.alt-text", "logo" )" />
          </header>
          <section>
             <div id="supportedDiv">

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


More information about the commits mailing list