Skip to content

Commit

Permalink
SHIBUI-1936
Browse files Browse the repository at this point in the history
Fixing issue with changing security settings from true to false
  • Loading branch information
chasegawa committed Oct 4, 2021
1 parent a23980f commit 119f62b
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,21 @@ public static void setupSecurity(EntityDescriptor ed, EntityDescriptorRepresenta
SecurityInfoRepresentation securityInfoRepresentation = representation.getSecurityInfo();
if (securityInfoRepresentation.isAuthenticationRequestsSigned()) {
getSPSSODescriptorFromEntityDescriptor(ed).setAuthnRequestsSigned(true);
} else {
// If false, only set if the spssodescriptor already exists and is true
SPSSODescriptor descriptor = ed.getSPSSODescriptor("");
if (descriptor != null && descriptor.isAuthnRequestsSigned()) {
descriptor.setAuthnRequestsSigned((Boolean)null);
}
}
if (securityInfoRepresentation.isWantAssertionsSigned()) {
getSPSSODescriptorFromEntityDescriptor(ed).setWantAssertionsSigned(true);
} else {
// If false, only set if the spssodescriptor already exists and is true
SPSSODescriptor descriptor = ed.getSPSSODescriptor("");
if (descriptor != null && descriptor.getWantAssertionsSigned()) {
descriptor.setWantAssertionsSigned((Boolean)null);
}
}
// TODO: review if we need more than a naive implementation
ed.getOptionalSPSSODescriptor().ifPresent( i -> i.getKeyDescriptors().clear());
Expand Down Expand Up @@ -375,4 +387,4 @@ public static void setupRelyingPartyOverrides(EntityDescriptor ed, EntityDescrip
getOptionalEntityAttributes(ed).ifPresent(entityAttributes -> entityAttributes.getAttributes().clear());
}
}
}
}

0 comments on commit 119f62b

Please sign in to comment.