use of org.openkilda.saml.service.SamlService in project open-kilda by telstra.
the class UrlMetadataProvider method getMetadataURI.
@Override
public String getMetadataURI() {
SamlService samlService = ApplicationContextProvider.getContext().getBean(SamlService.class);
SamlConfig samlConfig = samlService.getById(getMetaDataEntityId());
return samlConfig.getUrl();
}
use of org.openkilda.saml.service.SamlService in project open-kilda by telstra.
the class DbMetadataProvider method fetchMetadata.
// This example code simply does straight JDBC
@Override
protected byte[] fetchMetadata() throws MetadataProviderException {
try {
SamlService samlService = ApplicationContextProvider.getContext().getBean(SamlService.class);
SamlConfig samlConfig = samlService.getById(getMetaDataEntityId());
byte[] bytes = null;
if (samlConfig.getMetadata() != null) {
String metadata = samlConfig.getMetadata();
bytes = metadata.getBytes();
}
return bytes;
} catch (Exception e) {
String errorMessage = "Unable to query metadata from database with entityId = " + getMetaDataEntityId();
throw new MetadataProviderException(errorMessage, e);
}
}
Aggregations