Skip to content

Commit

Permalink
Properties set via "Configure Relying Party" control don't have effect
Browse files Browse the repository at this point in the history
on TRs based on a federation's TR #1285
  • Loading branch information
yurem committed Dec 10, 2018
1 parent b59b75c commit 8f4a886
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
Expand Up @@ -22,6 +22,7 @@
import org.gluu.oxtrust.model.GluuSAMLTrustRelationship;
import org.gluu.oxtrust.model.ProfileConfiguration;
import org.gluu.oxtrust.util.OxTrustConstants;
import org.slf4j.Logger;
import org.xdi.service.security.Secure;
import org.xdi.util.StringHelper;
import org.xdi.util.io.FileUploadWrapper;
Expand All @@ -43,6 +44,8 @@ public class RelyingPartyAction implements Serializable{

private ProfileConfiguration profileConfigurationSelected;

@Inject
private Logger log;

@Inject
private ProfileConfigurationService profileConfigurationService;
Expand All @@ -62,8 +65,7 @@ public String initProfileConfigurations() {
try {
profileConfigurationService.parseProfileConfigurations(trustRelationship);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
log.error("Failed to parse stored metadataFilter configuration for trustRelationship " + trustRelationship.getDn(), e);
}

availableProfileConfigurations = new ArrayList<String>();
Expand Down
Expand Up @@ -66,7 +66,7 @@ public class ProfileConfigurationService implements Serializable {

@Inject
private XmlService xmlService;

@Inject
private ConfigurationFactory configurationFactory;

Expand Down
Expand Up @@ -27,6 +27,7 @@
import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.inject.Named;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.validation.Schema;
import javax.xml.xpath.XPath;
Expand Down Expand Up @@ -344,15 +345,7 @@ private HashMap<String, Object> initTrustParamMap(List<GluuSAMLTrustRelationship

trustEntityIds.put(trustRelationship.getInum(), entityIds);

try {

filterService.parseFilters(trustRelationship);
profileConfigurationService.parseProfileConfigurations(trustRelationship);

} catch (Exception e) {
log.error("Failed to parse stored metadataFilter configuration for trustRelationship " + trustRelationship.getDn(), e);
e.printStackTrace();
}
initProfileConfiguration(trustRelationship);

if (trustRelationship.getMetadataFilters().get("signatureValidation") != null) {

Expand Down Expand Up @@ -401,8 +394,9 @@ private HashMap<String, Object> initTrustParamMap(List<GluuSAMLTrustRelationship
}

} else {
// add Part Of Federation
String federationInum = trustService.getTrustContainerFederation(trustRelationship).getInum();
initProfileConfiguration(trustRelationship);

String federationInum = trustRelationship.getContainerFederation().getInum();

if (deconstructedMap.get(federationInum) == null) {
deconstructedMap.put(federationInum, new ArrayList<String>());
Expand Down Expand Up @@ -434,6 +428,15 @@ private HashMap<String, Object> initTrustParamMap(List<GluuSAMLTrustRelationship
return trustParams;
}

protected void initProfileConfiguration(GluuSAMLTrustRelationship trustRelationship) throws FactoryConfigurationError {
try {
filterService.parseFilters(trustRelationship);
profileConfigurationService.parseProfileConfigurations(trustRelationship);
} catch (Exception e) {
log.error("Failed to parse stored metadataFilter configuration for trustRelationship " + trustRelationship.getDn(), e);
}
}

private HashMap<String, Object> initAttributeParamMap(List<GluuSAMLTrustRelationship> trustRelationships) {

HashMap<String, Object> attrParams = new HashMap<String, Object>();
Expand Down

0 comments on commit 8f4a886

Please sign in to comment.