Search in sources :

Example 1 with SamlService

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();
}
Also used : SamlService(org.openkilda.saml.service.SamlService) SamlConfig(org.openkilda.saml.model.SamlConfig)

Example 2 with SamlService

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);
    }
}
Also used : SamlService(org.openkilda.saml.service.SamlService) SamlConfig(org.openkilda.saml.model.SamlConfig) MetadataProviderException(org.opensaml.saml2.metadata.provider.MetadataProviderException) MetadataProviderException(org.opensaml.saml2.metadata.provider.MetadataProviderException)

Aggregations

SamlConfig (org.openkilda.saml.model.SamlConfig)2 SamlService (org.openkilda.saml.service.SamlService)2 MetadataProviderException (org.opensaml.saml2.metadata.provider.MetadataProviderException)1