use of ddf.security.samlp.MetadataConfigurationParser in project ddf by codice.
the class IdpEndpoint method parseServiceProviderMetadata.
private void parseServiceProviderMetadata(List<String> serviceProviderMetadata) {
if (serviceProviderMetadata != null) {
try {
MetadataConfigurationParser metadataConfigurationParser = new MetadataConfigurationParser(serviceProviderMetadata, ed -> {
EntityInformation entityInfo = new EntityInformation.Builder(ed, SUPPORTED_BINDINGS).build();
if (entityInfo != null) {
serviceProviders.put(ed.getEntityID(), entityInfo);
}
});
serviceProviders.putAll(metadataConfigurationParser.getEntryDescriptions().entrySet().stream().map(e -> Maps.immutableEntry(e.getKey(), new EntityInformation.Builder(e.getValue(), SUPPORTED_BINDINGS).build())).filter(e -> nonNull(e.getValue())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
} catch (IOException e) {
LOGGER.warn("Unable to parse SP metadata configuration. Check the configuration for SP metadata.", e);
}
}
}
use of ddf.security.samlp.MetadataConfigurationParser in project ddf by codice.
the class IdpMetadata method setMetadata.
public void setMetadata(String metadata) throws WSSecurityException, XMLStreamException, SAMLException, IOException {
MetadataConfigurationParser metadataConfigurationParser = new MetadataConfigurationParser(Collections.singletonList(metadata), ed -> entryDescriptions.put(ed.getEntityID(), ed));
entryDescriptions.putAll(metadataConfigurationParser.getEntryDescriptions());
}
Aggregations