[java-idp-oidc] branch main updated: JOIDC-143 - IdP logs message at WARN when attribute filter returns no values after filtering

Henri Mikkonen henri.mikkonen at iki.fi
Fri Apr 28 16:49:59 UTC 2023


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

hjmikkon pushed a commit to branch main
in repository java-idp-oidc.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-oidc.git;a=commit;h=0c7d51b3f15dd3264b176fc190ee6401bada7455

The following commit(s) were added to refs/heads/main by this push:
     new 0c7d51b3 JOIDC-143 - IdP logs message at WARN when attribute filter returns no values after filtering
0c7d51b3 is described below

commit 0c7d51b3f15dd3264b176fc190ee6401bada7455
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Apr 28 19:49:33 2023 +0300

    JOIDC-143 - IdP logs message at WARN when attribute filter returns no values after filtering
    
    https://shibboleth.atlassian.net/browse/JOIDC-143
    
    Don't return null when missing OIDCAuthenticationResponseContext: that's not an error
    with other protocols than OIDC.
---
 .../filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java  | 3 +--
 .../matcher/impl/AttributeInOIDCRequestedClaimsMatcherTest.java     | 6 ++++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java
index dc24aac9..015c7d98 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java
@@ -148,9 +148,8 @@ public class AttributeInOIDCRequestedClaimsMatcher extends AbstractIdentifiableI
         final OIDCAuthenticationResponseContext respCtx = profileRequestContext.getOutboundMessageContext()
                 .getSubcontext(OIDCAuthenticationResponseContext.class);
         if (respCtx == null) {
-            // This is always a failure.
             log.debug("{} No oidc response ctx for this comparison", getLogPrefix());
-            return null;
+            return Collections.emptySet();
         }
         
         if (respCtx.getMappedIdTokenRequestedClaims() == null && respCtx.getMappedUserinfoRequestedClaims() == null) {
diff --git a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcherTest.java b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcherTest.java
index d4a33e26..5c612c2b 100644
--- a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcherTest.java
+++ b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcherTest.java
@@ -139,11 +139,13 @@ public class AttributeInOIDCRequestedClaimsMatcherTest {
     }
 
     @Test
-    public void testFailNoOidcMsgCtx() throws Exception {
+    public void testNoOidcMsgCtx() throws Exception {
         setUp(false, false);
         matcher.initialize();
         prc.getOutboundMessageContext().removeSubcontext(OIDCAuthenticationResponseContext.class);
-        Assert.assertNull(matcher.getMatchingValues(attribute, filtercontext));
+        final Set<IdPAttributeValue> result = matcher.getMatchingValues(attribute, filtercontext);
+        Assert.assertNotNull(result);
+        Assert.assertEquals(result.size(), 0);
     }
 
     @Test

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


More information about the commits mailing list