* Initializes the STS configuration.
*/
protected void initSTSConfiguration() {
// if the sts configuration is present in the picketlink.xml then load it.
if (this.picketLinkConfiguration != null && this.picketLinkConfiguration.getStsType() != null) {
PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
sts.initialize(new PicketLinkSTSConfiguration(this.picketLinkConfiguration.getStsType()));
} else {
// Try to load from /WEB-INF/picketlink-sts.xml.
// Ensure that the Core STS has the SAML20 Token Provider
PicketLinkCoreSTS sts = PicketLinkCoreSTS.instance();
// Let us look for a file
String configPath = getContext().getServletContext().getRealPath("/WEB-INF/picketlink-sts.xml");
File stsTokenConfigFile = configPath != null ? new File(configPath) : null;
if (stsTokenConfigFile == null || stsTokenConfigFile.exists() == false) {
logger.samlIDPInstallingDefaultSTSConfig();
sts.installDefaultConfiguration();
} else
sts.installDefaultConfiguration(stsTokenConfigFile.toURI().toString());
}
}