[java-idp-plugin-duo] branch main updated: JDUO-80 - Use of Duo as a Passwordless solution
Scott Cantor
cantor.2 at osu.edu
Mon Apr 8 16:31:30 UTC 2024
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-idp-plugin-duo.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=0350a65c713c76e11e67188327e8eef6c285e11c
The following commit(s) were added to refs/heads/main by this push:
new 0350a65c JDUO-80 - Use of Duo as a Passwordless solution
0350a65c is described below
commit 0350a65c713c76e11e67188327e8eef6c285e11c
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Apr 8 12:31:27 2024 -0400
JDUO-80 - Use of Duo as a Passwordless solution
https://shibboleth.atlassian.net/browse/JDUO-80
If username is pre-populated, don't check for cookie or override it.
---
.../authn/duo/impl/PopulatePasswordlessContext.java | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/PopulatePasswordlessContext.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/PopulatePasswordlessContext.java
index 4fb3a494..88a9eb0d 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/PopulatePasswordlessContext.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/PopulatePasswordlessContext.java
@@ -40,15 +40,18 @@ import net.shibboleth.shared.security.DataSealer;
import net.shibboleth.shared.security.DataSealerException;
/**
- * A profile action to extract passwordless username from sealed cookie.
+ * A profile action to extract passwordless username from sealed cookie and populate it
+ * into an existing {@link DuoPasswordlessContext}.
+ *
+ * <p>If the context contains a username already, the action simply exits.</p>
*
* @since 2.1.0
*
* @event {@link EventIds#PROCEED_EVENT_ID}
* @event {@link EventIds#INVALID_PROFILE_CTX}
* @event {@link AuthnEventIds#REQUEST_UNSUPPORTED}
- * @pre <pre>AuthenticationContext.getSubcontext(DuoPasswordlessContext.class) != null</pre>
- * @post {@link DuoPasswordlessContext#setUsername(String)} is called with an existing value if found
+ * @pre <pre>AuthenticationContext.getSubcontext(DuoPasswordlessContext.class) != null</pre>
+ * @post <pre>DuoPasswordlessContext.getUsername() != null</pre>
*/
public class PopulatePasswordlessContext extends AbstractProfileAction {
@@ -150,6 +153,12 @@ public class PopulatePasswordlessContext extends AbstractProfileAction {
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
+ final String existingUsername = passwordlessContext.getUsername();
+ if (existingUsername != null) {
+ log.debug("Existing username '{}' in context left in place", getLogPrefix(), existingUsername);
+ return;
+ }
+
assert cookieName != null;
String cookie = cookieManager.getCookieValue(cookieName, null);
if (cookie == null) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list