[java-idp-plugin-totp] branch main updated: JTOTP-13 - Attribute seed resolver fails to install PRC lookup strategy

Scott Cantor cantor.2 at osu.edu
Wed Sep 4 14:52:47 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-totp.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-totp.git;a=commit;h=4e81ae772116fc2b8908bdb35c0d475bceba41d5

The following commit(s) were added to refs/heads/main by this push:
     new 4e81ae7  JTOTP-13 - Attribute seed resolver fails to install PRC lookup strategy
4e81ae7 is described below

commit 4e81ae772116fc2b8908bdb35c0d475bceba41d5
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Sep 4 10:52:41 2024 -0400

    JTOTP-13 - Attribute seed resolver fails to install PRC lookup strategy
    
    https://shibboleth.atlassian.net/browse/JTOTP-13
---
 .../plugin/authn/totp/impl/AttributeResolverSeedSource.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/totp-impl/src/main/java/net/shibboleth/idp/plugin/authn/totp/impl/AttributeResolverSeedSource.java b/totp-impl/src/main/java/net/shibboleth/idp/plugin/authn/totp/impl/AttributeResolverSeedSource.java
index 3e6ed0a..9830275 100644
--- a/totp-impl/src/main/java/net/shibboleth/idp/plugin/authn/totp/impl/AttributeResolverSeedSource.java
+++ b/totp-impl/src/main/java/net/shibboleth/idp/plugin/authn/totp/impl/AttributeResolverSeedSource.java
@@ -19,6 +19,7 @@ import java.util.Collection;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
+import org.opensaml.messaging.context.navigate.ParentContextLookup;
 import org.opensaml.profile.context.ProfileRequestContext;
 import org.slf4j.Logger;
 
@@ -26,6 +27,7 @@ import net.shibboleth.idp.attribute.IdPAttribute;
 import net.shibboleth.idp.attribute.StringAttributeValue;
 import net.shibboleth.idp.attribute.resolver.AttributeResolver;
 import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
+import net.shibboleth.idp.authn.context.AuthenticationContext;
 import net.shibboleth.idp.plugin.authn.totp.context.TOTPContext;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.annotation.constraint.NotEmpty;
@@ -36,6 +38,7 @@ import net.shibboleth.shared.codec.DecodingException;
 import net.shibboleth.shared.collection.CollectionSupport;
 import net.shibboleth.shared.component.ComponentInitializationException;
 import net.shibboleth.shared.logic.Constraint;
+import net.shibboleth.shared.logic.FunctionSupport;
 import net.shibboleth.shared.primitive.LoggerFactory;
 import net.shibboleth.shared.primitive.StringSupport;
 import net.shibboleth.shared.service.ReloadableService;
@@ -103,6 +106,15 @@ public class AttributeResolverSeedSource extends AbstractSeedSource {
             resCtx.setResolutionLabel("TOTP");
             resCtx.setPrincipal(totp.getUsername());
             resCtx.setRequestedIdPAttributeNames(CollectionSupport.singletonList(attributeId));
+            
+            // this -> TOTPContext -> AuthenticationContext -> PRC
+            resCtx.setProfileRequestContextLookupStrategy(
+                    FunctionSupport.compose(
+                            new ParentContextLookup<>(ProfileRequestContext.class),
+                            FunctionSupport.compose(
+                                    new ParentContextLookup<>(AuthenticationContext.class),
+                                    new ParentContextLookup<>(TOTPContext.class)))
+                    );
 
             log.debug("Resolving attribute {} for '{}'", attributeId, totp.getUsername());
 

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


More information about the commits mailing list