[java-opensaml] 04/16: Always add entityID and role to TLS criteria.

Brent Putman putmanb at georgetown.edu
Fri Sep 21 22:48:42 EDT 2018


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

putmanb pushed a commit to branch master
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=00dc24e65ddb6d046590c8a71535d1ed8b6abed5

commit 00dc24e65ddb6d046590c8a71535d1ed8b6abed5
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Wed Sep 19 21:41:37 2018 -0400

    Always add entityID and role to TLS criteria.
---
 .../messaging/soap/SAMLSOAPClientContextBuilder.java   | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/messaging/soap/SAMLSOAPClientContextBuilder.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/messaging/soap/SAMLSOAPClientContextBuilder.java
index 1b182e8..22719ad 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/common/messaging/soap/SAMLSOAPClientContextBuilder.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/common/messaging/soap/SAMLSOAPClientContextBuilder.java
@@ -401,23 +401,21 @@ public class SAMLSOAPClientContextBuilder<InboundMessageType extends SAMLObject,
             }
             
             final SAMLPeerEntityContext peerContext = parent.getSubcontext(SAMLPeerEntityContext.class);
-            if (peerContext == null) {
-                return criteria;
-            }
-            
-            final SAMLMetadataContext metadataContext = peerContext.getSubcontext(SAMLMetadataContext.class);
-            if (metadataContext != null && metadataContext.getRoleDescriptor() != null) {
-                criteria.add(new RoleDescriptorCriterion(metadataContext.getRoleDescriptor()));
-                return criteria;
-            } else {
+            if (peerContext != null) {
                 if (peerContext.getEntityId() != null) {
                     criteria.add(new EntityIdCriterion(peerContext.getEntityId()));
                 }
                 if (peerContext.getRole() != null) {
                     criteria.add(new EntityRoleCriterion(peerContext.getRole()));
                 }
-                return criteria;
+                
+                final SAMLMetadataContext metadataContext = peerContext.getSubcontext(SAMLMetadataContext.class);
+                if (metadataContext != null && metadataContext.getRoleDescriptor() != null) {
+                    criteria.add(new RoleDescriptorCriterion(metadataContext.getRoleDescriptor()));
+                }
             }
+            
+            return criteria;
         }
         
     }

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


More information about the commits mailing list