Skip to content

Commit

Permalink
Adding missing option to specify keystore alias in SAML 2.0 SP4UI con…
Browse files Browse the repository at this point in the history
…figuration
  • Loading branch information
ilgrosso committed Jul 3, 2023
1 parent 1218877 commit d557acb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.Optional;
import org.apache.syncope.common.lib.to.EntityTO;
import org.apache.syncope.core.logic.saml2.NoOpLogoutHandler;
import org.pac4j.saml.config.SAML2Configuration;
Expand Down Expand Up @@ -50,7 +51,10 @@ protected SAML2Configuration newSAML2Configuration() {
props.getKeystoreKeypass(),
null);

cfg.setKeystoreType(props.getKeystoreType());
Optional.ofNullable(props.getKeystoreAlias()).ifPresent(cfg::setKeystoreAlias);

cfg.setKeystoreType(Optional.ofNullable(props.getKeystoreType()).orElseGet(() -> KeyStore.getDefaultType()));

if (cfg.getKeystoreResource() instanceof FileUrlResource) {
cfg.setKeystoreGenerator(new BaseSAML2KeystoreGenerator(cfg) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class SAML2SP4UIProperties {

private String keystoreKeypass;

private String keystoreAlias;

private long skew;

public String getKeystore() {
Expand Down Expand Up @@ -65,6 +67,14 @@ public void setKeystoreKeypass(final String keystoreKeypass) {
this.keystoreKeypass = keystoreKeypass;
}

public String getKeystoreAlias() {
return keystoreAlias;
}

public void setKeystoreAlias(final String keystoreAlias) {
this.keystoreAlias = keystoreAlias;
}

public long getSkew() {
return skew;
}
Expand Down

0 comments on commit d557acb

Please sign in to comment.