[java-idp-plugin-webauthn] branch main updated: Update views to support username collection for registration
Phil Smart
philip.smart at jisc.ac.uk
Fri Feb 16 11:48:00 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=d2c1dd808cc90359c69e396038f2fd260c0c2daf
The following commit(s) were added to refs/heads/main by this push:
new d2c1dd8 Update views to support username collection for registration
d2c1dd8 is described below
commit d2c1dd808cc90359c69e396038f2fd260c0c2daf
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Feb 16 11:47:57 2024 +0000
Update views to support username collection for registration
---
...n-username.vm => webauthn-register-username.vm} | 38 +++-------------------
.../authn/webauthn/views/webauthn-register.vm | 8 +----
.../authn/webauthn/views/webauthn-selector.vm | 35 ++++++++++----------
.../authn/webauthn/views/webauthn-username.vm | 11 ++++---
4 files changed, 30 insertions(+), 62 deletions(-)
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-username.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register-username.vm
similarity index 64%
copy from webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-username.vm
copy to webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register-username.vm
index 3186abe..089db99 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-username.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-register-username.vm
@@ -6,8 +6,6 @@
## flowRequestContext - the Spring Web Flow RequestContext
## flowExecutionKey - the SWF execution key (this is built into the flowExecutionUrl)
## profileRequestContext - root of context tree
-## authenticationContext - context with authentication request information
-## passwordlessContext - context with Duo username and enrollment status
## rpUIContext - the context with SP UI information from the metadata
## encoder - HTMLEncoder class
## cspDigester - Calculates base64-encoded SHA-2 hashes (call apply)
@@ -42,35 +40,12 @@ $response.addHeader("Content-Security-Policy", "script-src-elem 'nonce-$nonce'")
<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
+ <section>
- <blockquote>#springMessageText("idp.duo.passwordless.explain", "If you've enrolled a passkey or device/token for passwordless login,
- please enter your username below and press the corresponding button.")</blockquote>
+ <blockquote>#springMessageText("idp.webauthn.register.username.explain", "Please enter your username below and press the corresponding button.")</blockquote>
@@ -88,19 +63,16 @@ $response.addHeader("Content-Security-Policy", "script-src-elem 'nonce-$nonce'")
<input type="checkbox" name="donotcache" value="1" id="donotcache" />
<label for="donotcache">#springMessageText("idp.login.donotcache", "Don't Remember Login")</label>
- <input id="_shib_idp_revokeConsent" type="checkbox" name="_shib_idp_revokeConsent" value="true" />
- <label for="_shib_idp_revokeConsent">#springMessageText("idp.attribute-release.revoke", "Clear prior granting of permission for release of your information to this service.")</label>
-
+
<div class="grid">
<div class="grid-item">
<button type="submit" name="_eventId_proceed"
- >#springMessageText("idp.webauthn.passwordless.proceed", "Login with Security Key")</button>
+ >#springMessageText("idp.webauthn.register.username.proceed", "Next")</button>
</div>
</div>
</form>
<ul>
- <li><a href="#springMessageText('idp.duo.enrollment.url', '/idp/profile/admin/webauthn-registration')">#springMessageText("idp.duo.enrollment", "Enroll New Devices")</a></li>
<li><a href="#springMessageText('idp.url.helpdesk', '#')">#springMessageText("idp.login.needHelp", "Need Help?")</a></li>
</ul>
</section>
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 97aa4e9..c184e2f 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
@@ -6,8 +6,6 @@
## flowRequestContext - the Spring Web Flow RequestContext
## flowExecutionKey - the SWF execution key (this is built into the flowExecutionUrl)
## profileRequestContext - root of context tree
-## authenticationContext - context with authentication request information
-## authenticationErrorContext - context with login error state
## webauthnRegContext = WebAuthn registration context
## authenticationWarningContext - context with login warning state
## rpUIContext - the context with SP UI information from the metadata
@@ -19,7 +17,6 @@
## custom - arbitrary object injected by deployer
##
#set ($debug = $environment.getProperty("idp.authn.webauthn.ui.debug", "false"))
-#set ($rpContext = $profileRequestContext.getSubcontext('net.shibboleth.profile.context.RelyingPartyContext'))
##
<!DOCTYPE html>
<html>
@@ -89,10 +86,7 @@
<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">
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 d9d9150..701f49f 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
@@ -22,6 +22,7 @@
<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">
@@ -33,23 +34,23 @@
<h1>#springMessageText("idp.login.loginTo", "Login to") $encoder.encodeForHTML($serviceName)</h1>
#end
</header>
- <section>
- <form action="$flowExecutionUrl" method="post">
- #parse("csrf/csrf.vm")
- <div class="grid">
- <div class="grid-item">
- <button type="submit" name="_eventId_proceed">Use Security Key</button>
- </div>
- </div>
- </form>
- <form action="$flowExecutionUrl" method="post">
- #parse("csrf/csrf.vm")
- <div class="grid">
- <div class="grid-item">
- <button type="submit" name="_eventId_password">Use Password</button>
- </div>
- </div>
- </form>
+ <section>
+ <div class="centre">
+ <div class="grid">
+ <div class="grid-item">
+ <form action="$flowExecutionUrl" method="post">
+ #parse("csrf/csrf.vm")
+ <button type="submit" name="_eventId_proceed">Use Security Key</button>
+ </form>
+ </div>
+ <div class="grid-item">
+ <form action="$flowExecutionUrl" method="post">
+ #parse("csrf/csrf.vm")
+ <button type="submit" name="_eventId_password">Use Password</button>
+ </form>
+ </div>
+ </div>
+ </div>
</section>
</main>
<footer class="footer">
diff --git a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-username.vm b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-username.vm
index 3186abe..4c59a7c 100644
--- a/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-username.vm
+++ b/webauthn-impl/src/main/resources/net/shibboleth/idp/plugin/authn/webauthn/views/webauthn-username.vm
@@ -69,7 +69,7 @@ $response.addHeader("Content-Security-Policy", "script-src-elem 'nonce-$nonce'")
<p>$encoder.encodeForHTML($desc)</p>
#end
- <blockquote>#springMessageText("idp.duo.passwordless.explain", "If you've enrolled a passkey or device/token for passwordless login,
+ <blockquote>#springMessageText("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.")</blockquote>
@@ -88,9 +88,10 @@ $response.addHeader("Content-Security-Policy", "script-src-elem 'nonce-$nonce'")
<input type="checkbox" name="donotcache" value="1" id="donotcache" />
<label for="donotcache">#springMessageText("idp.login.donotcache", "Don't Remember Login")</label>
- <input id="_shib_idp_revokeConsent" type="checkbox" name="_shib_idp_revokeConsent" value="true" />
- <label for="_shib_idp_revokeConsent">#springMessageText("idp.attribute-release.revoke", "Clear prior granting of permission for release of your information to this service.")</label>
-
+ #if ($serviceName && !$rpContext.getRelyingPartyId().contains($serviceName))
+ <input id="_shib_idp_revokeConsent" type="checkbox" name="_shib_idp_revokeConsent" value="true" />
+ <label for="_shib_idp_revokeConsent">#springMessageText("idp.attribute-release.revoke", "Clear prior granting of permission for release of your information to this service.")</label>
+ #end
<div class="grid">
<div class="grid-item">
<button type="submit" name="_eventId_proceed"
@@ -100,7 +101,7 @@ $response.addHeader("Content-Security-Policy", "script-src-elem 'nonce-$nonce'")
</form>
<ul>
- <li><a href="#springMessageText('idp.duo.enrollment.url', '/idp/profile/admin/webauthn-registration')">#springMessageText("idp.duo.enrollment", "Enroll New Devices")</a></li>
+ <li><a href="#springMessageText('idp.webauthn.enrollment.url', '/idp/profile/admin/webauthn-registration')">#springMessageText("idp.duo.enrollment", "Enroll New Devices")</a></li>
<li><a href="#springMessageText('idp.url.helpdesk', '#')">#springMessageText("idp.login.needHelp", "Need Help?")</a></li>
</ul>
</section>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list