Class MetadataProviderSettings

java.lang.Object
se.swedenconnect.spring.saml.idp.settings.AbstractSettings
se.swedenconnect.spring.saml.idp.settings.MetadataProviderSettings
All Implemented Interfaces:
Serializable

public class MetadataProviderSettings extends AbstractSettings
Settings for configuring SAML metadata providers (resolvers).
Author:
Martin Lindström
See Also:
  • Field Details

    • SAML_METADATA_PROVIDER_LOCATION

      public static final String SAML_METADATA_PROVIDER_LOCATION
      The location of the metadata. Can be a URL, a file, or even a classpath resource. Represented using a Resource.
      See Also:
    • SAML_METADATA_PROVIDER_HTTPS_TRUST_BUNDLE

      public static final String SAML_METADATA_PROVIDER_HTTPS_TRUST_BUNDLE
      If the location is an HTTPS resource, this setting may be used to specify a Spring SSL Bundle that gives the TrustManagers to use during TLS verification. If no bundle is given, the Java trust default will be used.
      See Also:
    • SAML_METADATA_PROVIDER_SKIP_HOSTNAME_VERIFICATION

      public static final String SAML_METADATA_PROVIDER_SKIP_HOSTNAME_VERIFICATION
      If the location is an HTTPS resource, this setting tells whether to skip hostname verification in the TLS connection (useful during testing).
      See Also:
    • SAML_METADATA_PROVIDER_BACKUP_LOCATION

      public static final String SAML_METADATA_PROVIDER_BACKUP_LOCATION
      If the location setting is a URL, a "backup location" may be assigned to store downloaded metadata. A File.
      See Also:
    • SAML_METADATA_PROVIDER_MDQ

      public static final String SAML_METADATA_PROVIDER_MDQ
      If the location setting is a URL, setting the MDQ-flag means that the metadata MDQ (https://www.ietf.org/id/draft-young-md-query-17.html) protocol is used. A Boolean.
      See Also:
    • SAML_METADATA_PROVIDER_VALIDATION_CERTIFICATE

      public static final String SAML_METADATA_PROVIDER_VALIDATION_CERTIFICATE
      The certificate used to validate the metadata. A X509Certificate.
      See Also:
    • SAML_METADATA_PROVIDER_HTTP_PROXY

      public static final String SAML_METADATA_PROVIDER_HTTP_PROXY
      If the location setting is a URL and an HTTP proxy is required this setting configures this proxy. A MetadataProviderSettings.HttpProxySettings.
      See Also:
  • Constructor Details

    • MetadataProviderSettings

      protected MetadataProviderSettings(Map<String,Object> settings)
      Constructor.
      Parameters:
      settings - the settings
  • Method Details

    • getLocation

      public Resource getLocation()
      Gets the location of the metadata. Can be a URL, a file, or even a classpath resource.
      Returns:
      the metadata location
    • getHttpsTrustBundle

      public String getHttpsTrustBundle()
      Gives the Spring SSL Bundle that gives us the TLS trust settings to use during TLS verification. If null, the Java trust default will be used.

      Only relevant if the location is an HTTPS resource.

      Returns:
      a name for a trust SSL bundle, or null if not assigned
    • getSkipHostnameVerification

      public Boolean getSkipHostnameVerification()
      Tells whether to skip hostname verification in the TLS connection (useful during testing).
      Returns:
      true if hostname verification should be skipped
    • getBackupLocation

      public File getBackupLocation()
      If the location setting is a URL, a "backup location" may be assigned to store downloaded metadata. This method returns this file.
      Returns:
      a file or null
    • getMdq

      public Boolean getMdq()
      If the location setting is a URL, setting the MDQ-flag means that the metadata MDQ (https://www.ietf.org/id/draft-young-md-query-17.html) protocol is used. This method returns this setting.
      Returns:
      whether MDQ is active or not
    • getValidationCertificate

      public X509Certificate getValidationCertificate()
      Gets the certificate used to validate the metadata.
      Returns:
      the validation certificate or null if not assigned
    • getHttpProxy

      Gets the HTTP proxy settings.
      Returns:
      the proxy settings or null
    • builder

      public static MetadataProviderSettings.Builder builder()
      Constructs a new MetadataProviderSettings.Builder with no settings.
      Returns:
      the MetadataProviderSettings.Builder
    • withSettings

      public static MetadataProviderSettings.Builder withSettings(Map<String,Object> settings)
      Constructs a new MetadataProviderSettings.Builder with the provided settings.
      Parameters:
      settings - the settings to initialize the builder
      Returns:
      the builder