[java-identity-provider] branch main updated: IDP-1868 - Attribute-based subject c14n is mishandling Scoped values

Scott Cantor cantor.2 at osu.edu
Tue Oct 12 18:06:57 UTC 2021


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=70cacdfae05538a9139e344ca4795fe556415c44

The following commit(s) were added to refs/heads/main by this push:
     new 70cacdfae IDP-1868 - Attribute-based subject c14n is mishandling Scoped values
70cacdfae is described below

commit 70cacdfae05538a9139e344ca4795fe556415c44
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Oct 12 14:06:52 2021 -0400

    IDP-1868 - Attribute-based subject c14n is mishandling Scoped values
    
    https://shibboleth.atlassian.net/browse/IDP-1868
---
 .../impl/AttributeSourcedSubjectCanonicalization.java      | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalization.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalization.java
index 7305440ab..f5168f7f5 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalization.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AttributeSourcedSubjectCanonicalization.java
@@ -230,7 +230,13 @@ public class AttributeSourcedSubjectCanonicalization extends AbstractSubjectCano
     @Nullable private String findValue(@Nonnull final IdPAttribute attribute) {
         
         for (final IdPAttributeValue val : attribute.getValues()) {
-            if (val instanceof StringAttributeValue) {
+            if (val instanceof ScopedStringAttributeValue) {
+                final ScopedStringAttributeValue scoped = (ScopedStringAttributeValue) val;
+                final String withScope = scoped.getValue() + delimiter + scoped.getScope();
+                log.debug("{} Using attribute {} scoped value {} as input to transforms", getLogPrefix(),
+                        attribute.getId(), withScope);
+                return applyTransforms(withScope);
+            } else if (val instanceof StringAttributeValue) {
                 final StringAttributeValue stringVal = (StringAttributeValue) val;
                 if (stringVal.getValue() == null || stringVal.getValue().isEmpty()) {
                     log.debug("{} Ignoring null/empty string value", getLogPrefix());
@@ -239,12 +245,6 @@ public class AttributeSourcedSubjectCanonicalization extends AbstractSubjectCano
                 log.debug("{} Using attribute {} string value {} as input to transforms", getLogPrefix(),
                         attribute.getId(), stringVal.getValue());
                 return applyTransforms(stringVal.getValue());
-            } else if (val instanceof ScopedStringAttributeValue) {
-                final ScopedStringAttributeValue scoped = (ScopedStringAttributeValue) val;
-                final String withScope = scoped.getValue() + delimiter + scoped.getScope();
-                log.debug("{} Using attribute {} scoped value {} as input to transforms", getLogPrefix(),
-                        attribute.getId(), withScope);
-                return applyTransforms(withScope);
             } else {
                 log.warn("{} Unsupported attribute value type: {}", getLogPrefix(), val.getClass().getName());
             }

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


More information about the commits mailing list