Class UrlResourceMetadataResolver

    • Constructor Detail

      • UrlResourceMetadataResolver

        public UrlResourceMetadataResolver​(org.apereo.cas.util.http.HttpClient httpClient,
                                           org.apereo.cas.configuration.model.support.saml.idp.SamlIdPProperties samlIdPProperties,
                                           org.apereo.cas.support.saml.OpenSamlConfigBean configBean)
    • Method Detail

      • resolve

        public java.util.Collection<? extends org.opensaml.saml.metadata.resolver.MetadataResolver> resolve​(org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                                                                            net.shibboleth.utilities.java.support.resolver.CriteriaSet criteriaSet)
        Description copied from interface: SamlRegisteredServiceMetadataResolver
        Resolve list.
        Parameters:
        service - the service
        criteriaSet - the criteria set
        Returns:
        the list
      • supports

        public boolean supports​(org.apereo.cas.support.saml.services.SamlRegisteredService service)
        Description copied from interface: SamlRegisteredServiceMetadataResolver
        Supports this service?
        Parameters:
        service - the service
        Returns:
        true/false
      • isAvailable

        public boolean isAvailable​(org.apereo.cas.support.saml.services.SamlRegisteredService service)
        Description copied from interface: SamlRegisteredServiceMetadataResolver
        Is the resolver available and able to resolve metadata? This method may contact the metadata source checking for the source availability.
        Parameters:
        service - the service
        Returns:
        true /false
      • shouldHttpResponseStatusBeProcessed

        protected boolean shouldHttpResponseStatusBeProcessed​(org.springframework.http.HttpStatus status)
        Should http response status be processed?
        Parameters:
        status - the status
        Returns:
        true /false
      • getMetadataResolverFromResponse

        protected org.opensaml.saml.metadata.resolver.impl.AbstractMetadataResolver getMetadataResolverFromResponse​(org.apache.http.HttpResponse response,
                                                                                                                    java.io.File backupFile)
                                                                                                             throws java.lang.Exception
        Gets metadata resolver from response.
        Parameters:
        response - the response
        backupFile - the backup file
        Returns:
        the metadata resolver from response
        Throws:
        java.lang.Exception - the exception
      • fetchMetadata

        protected org.apache.http.HttpResponse fetchMetadata​(org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                             java.lang.String metadataLocation,
                                                             net.shibboleth.utilities.java.support.resolver.CriteriaSet criteriaSet,
                                                             java.io.File backupFile)
        Fetch metadata http response.
        Parameters:
        service - the service
        metadataLocation - the metadata location
        criteriaSet - the criteria set
        backupFile - the backup file
        Returns:
        the http response
      • getMetadataLocationForService

        protected java.lang.String getMetadataLocationForService​(org.apereo.cas.support.saml.services.SamlRegisteredService service,
                                                                 net.shibboleth.utilities.java.support.resolver.CriteriaSet criteriaSet)
        Gets metadata location for service.
        Parameters:
        service - the service
        criteriaSet - the criteria set
        Returns:
        the metadata location for service
      • getMetadataBackupFile

        protected java.io.File getMetadataBackupFile​(org.springframework.core.io.AbstractResource metadataResource,
                                                     org.apereo.cas.support.saml.services.SamlRegisteredService service)
                                              throws java.io.IOException
        Gets metadata backup file.
        Parameters:
        metadataResource - the metadata resource
        service - the service
        Returns:
        the metadata backup file
        Throws:
        java.io.IOException - the io exception
      • getBackupMetadataFilenamePrefix

        protected java.lang.String getBackupMetadataFilenamePrefix​(org.springframework.core.io.AbstractResource metadataResource,
                                                                   org.apereo.cas.support.saml.services.SamlRegisteredService service)
        Gets backup metadata filename prefix.

        The metadata source may be an aggregate, representing more than on entity id inside the single registered service definition. Therefor, using the service's name or id may not be appropriate choice as compounds in the metadata file name.

        Parameters:
        metadataResource - the metadata resource
        service - the service
        Returns:
        the backup metadata filename prefix