[java-identity-provider] branch main updated: IDP-2255 - Warn if defaultAuthnMethods used without disallowedFeatures

Scott Cantor cantor.2 at osu.edu
Tue Feb 18 20:44:47 UTC 2025


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=b99e0051e51dce7b06cff72308df5b8045aee38b

The following commit(s) were added to refs/heads/main by this push:
     new b99e0051e IDP-2255 - Warn if defaultAuthnMethods used without disallowedFeatures
b99e0051e is described below

commit b99e0051e51dce7b06cff72308df5b8045aee38b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Feb 18 15:44:44 2025 -0500

    IDP-2255 - Warn if defaultAuthnMethods used without disallowedFeatures
    
    https://shibboleth.atlassian.net/browse/IDP-2255
    
    Reordered code in InitializeRequestedPrincipalContext action.
---
 .../authn/impl/InitializeRequestedPrincipalContext.java | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContext.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContext.java
index fcc3933c4..c3bf3c369 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContext.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/InitializeRequestedPrincipalContext.java
@@ -105,10 +105,6 @@ public class InitializeRequestedPrincipalContext extends AbstractAuthenticationA
         
         if (!super.doPreExecute(profileRequestContext, authenticationContext)) {
             return false;
-        } else if (authenticationContext.getSubcontext(RequestedPrincipalContext.class) != null
-                && !replaceExistingContext) {
-            log.debug("{} Leaving existing RequestedPrincipalContext in place", getLogPrefix());
-            return false;
         }
         
         final RelyingPartyContext rpCtx = relyingPartyContextLookupStrategy.apply(profileRequestContext);
@@ -147,6 +143,19 @@ public class InitializeRequestedPrincipalContext extends AbstractAuthenticationA
             return;
         }
 
+        if (authenticationContext.getSubcontext(RequestedPrincipalContext.class) != null) {
+            if (replaceExistingContext) {
+                log.info("{} Replacing explicitly requested authentication criteria from relying party",
+                        getLogPrefix());
+                // continue to process profile-driven setting below
+            } else {
+                log.warn("{} Profile config overridden by explicitly requested authentication criteria, " +
+                        "consider disallowing with disallowedFeatures property", getLogPrefix());
+                return;
+            }
+        }
+        
+        
         final RequestedPrincipalContext principalCtx = new RequestedPrincipalContext();
         principalCtx.setOperator("exact");
         principalCtx.setRequestedPrincipals(principals);

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


More information about the commits mailing list