Search in sources :

Example 1 with MetadataConfigurationParser

use of ddf.security.samlp.impl.MetadataConfigurationParser in project ddf by codice.

the class IdpMetadata method parseMetadata.

@VisibleForTesting
@Nullable
protected Map<String, EntityDescriptor> parseMetadata() {
    final Map<String, EntityDescriptor> processMap = new ConcurrentHashMap<>();
    MetadataConfigurationParser metadataConfigurationParser;
    try {
        metadataConfigurationParser = new MetadataConfigurationParser(Collections.singletonList(metadata), ed -> processMap.put(ed.getEntityID(), ed));
    } catch (IOException e) {
        LOGGER.debug("Error parsing SSO metadata", e);
        return null;
    }
    processMap.putAll(metadataConfigurationParser.getEntityDescriptors());
    return processMap;
}
Also used : StringUtils(org.apache.commons.lang.StringUtils) MetadataConfigurationParser(ddf.security.samlp.impl.MetadataConfigurationParser) UsageType(org.opensaml.security.credential.UsageType) Logger(org.slf4j.Logger) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) DateTime(org.joda.time.DateTime) LoggerFactory(org.slf4j.LoggerFactory) Set(java.util.Set) IOException(java.io.IOException) KeyDescriptor(org.opensaml.saml.saml2.metadata.KeyDescriptor) Instant(java.time.Instant) AtomicReference(java.util.concurrent.atomic.AtomicReference) Endpoint(org.opensaml.saml.saml2.metadata.Endpoint) Objects(java.util.Objects) List(java.util.List) Duration(java.time.Duration) Map(java.util.Map) Optional(java.util.Optional) IDPSSODescriptor(org.opensaml.saml.saml2.metadata.IDPSSODescriptor) VisibleForTesting(com.google.common.annotations.VisibleForTesting) EntityDescriptor(org.opensaml.saml.saml2.metadata.EntityDescriptor) Collections(java.util.Collections) Nullable(javax.annotation.Nullable) EntityDescriptor(org.opensaml.saml.saml2.metadata.EntityDescriptor) MetadataConfigurationParser(ddf.security.samlp.impl.MetadataConfigurationParser) IOException(java.io.IOException) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Nullable(javax.annotation.Nullable)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 MetadataConfigurationParser (ddf.security.samlp.impl.MetadataConfigurationParser)1 IOException (java.io.IOException)1 Duration (java.time.Duration)1 Instant (java.time.Instant)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 Set (java.util.Set)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 Nullable (javax.annotation.Nullable)1 StringUtils (org.apache.commons.lang.StringUtils)1 DateTime (org.joda.time.DateTime)1 Endpoint (org.opensaml.saml.saml2.metadata.Endpoint)1 EntityDescriptor (org.opensaml.saml.saml2.metadata.EntityDescriptor)1 IDPSSODescriptor (org.opensaml.saml.saml2.metadata.IDPSSODescriptor)1 KeyDescriptor (org.opensaml.saml.saml2.metadata.KeyDescriptor)1