Skip to content

Commit

Permalink
Merge pull request #98 from GluuFederation/issue_82
Browse files Browse the repository at this point in the history
fix(oxtrust-api): save attributes on tr api call
  • Loading branch information
yurem authored Jan 28, 2025
2 parents 595eb49 + 3d7b92c commit 1ed2626
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -979,16 +979,18 @@ private static List<SAMLTrustRelationshipShort> convertTRtoTRShort (List<GluuSAM

private String updateReleasedAttributes(GluuSAMLTrustRelationship trustRelationship) {
List<String> releasedAttributes = new ArrayList<String>();
for (String attribute : trustRelationship.getReleasedAttributes()) {
GluuAttribute gluuAttribute = null;
try {
gluuAttribute = attributeService.getAttributeByDn(attribute);
} catch (Exception e) {
logger.debug("Invalid Attribute Dn : {} ",attribute);
return "Trust Relationship Operation failed due to invalid attribute : "+ attribute;
if((trustRelationship.getReleasedAttributes() != null) && !trustRelationship.getReleasedAttributes().isEmpty()) {
for (String attribute : trustRelationship.getReleasedAttributes()) {
GluuAttribute gluuAttribute = null;
try {
gluuAttribute = attributeService.getAttributeByDn(attribute);
} catch (Exception e) {
logger.debug("Invalid Attribute Dn : {} ", attribute);
return "Trust Relationship Operation failed due to invalid attribute : " + attribute;
}
if (gluuAttribute != null)
releasedAttributes.add(attribute);
}
if(gluuAttribute != null)
releasedAttributes.add(attribute);
}

if (!releasedAttributes.isEmpty()) {
Expand Down

0 comments on commit 1ed2626

Please sign in to comment.