Class BaseSAML2MetadataGenerator

java.lang.Object
org.pac4j.saml.metadata.BaseSAML2MetadataGenerator
All Implemented Interfaces:
SAML2MetadataGenerator
Direct Known Subclasses:
SAML2FileSystemMetadataGenerator, SAML2HttpUrlMetadataGenerator, SAML2JdbcMetadataGenerator, SAML2MongoMetadataGenerator

public abstract class BaseSAML2MetadataGenerator extends Object implements SAML2MetadataGenerator
Generates metadata object with standard values and overridden user defined values.
Since:
4.0.1
Author:
Misagh Moayyed
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
    • builderFactory

      protected final org.opensaml.core.xml.XMLObjectBuilderFactory builderFactory
    • marshallerFactory

      protected final org.opensaml.core.xml.io.MarshallerFactory marshallerFactory
    • globalAlgorithmRegistry

      protected final org.opensaml.xmlsec.algorithm.AlgorithmRegistry globalAlgorithmRegistry
    • credentialProvider

      protected CredentialProvider credentialProvider
    • entityId

      protected String entityId
    • assertionConsumerServiceUrl

      protected String assertionConsumerServiceUrl
    • responseBindingType

      protected String responseBindingType
    • singleLogoutServiceUrl

      protected String singleLogoutServiceUrl
    • authnRequestSigned

      protected boolean authnRequestSigned
    • wantAssertionSigned

      protected boolean wantAssertionSigned
    • signMetadata

      protected boolean signMetadata
    • defaultACSIndex

      protected int defaultACSIndex
    • requestInitiatorLocation

      protected String requestInitiatorLocation
    • nameIdPolicyFormat

      protected String nameIdPolicyFormat
    • requestedAttributes

      protected List<SAML2ServiceProviderRequestedAttribute> requestedAttributes
    • defaultSignatureSigningConfiguration

      protected org.opensaml.xmlsec.SignatureSigningConfiguration defaultSignatureSigningConfiguration
    • blackListedSignatureSigningAlgorithms

      protected List<String> blackListedSignatureSigningAlgorithms
    • signatureAlgorithms

      protected List<String> signatureAlgorithms
    • signatureReferenceDigestMethods

      protected List<String> signatureReferenceDigestMethods
  • Constructor Details

    • BaseSAML2MetadataGenerator

      public BaseSAML2MetadataGenerator()
  • Method Details

    • buildMetadataResolver

      public org.opensaml.saml.metadata.resolver.MetadataResolver buildMetadataResolver() throws Exception

      buildMetadataResolver.

      Specified by:
      buildMetadataResolver in interface SAML2MetadataGenerator
      Returns:
      a MetadataResolver object
      Throws:
      Exception - if any.
    • createMetadataResolver

      protected abstract org.opensaml.saml.metadata.resolver.impl.AbstractMetadataResolver createMetadataResolver() throws Exception

      createMetadataResolver.

      Returns:
      a AbstractMetadataResolver object
      Throws:
      Exception - if any.
    • getMetadata

      public String getMetadata(org.opensaml.saml.saml2.metadata.EntityDescriptor entityDescriptor) throws Exception

      getMetadata.

      Specified by:
      getMetadata in interface SAML2MetadataGenerator
      Parameters:
      entityDescriptor - a EntityDescriptor object
      Returns:
      a String object
      Throws:
      Exception - if any.
    • buildEntityDescriptor

      public org.opensaml.saml.saml2.metadata.EntityDescriptor buildEntityDescriptor()

      buildEntityDescriptor.

      Specified by:
      buildEntityDescriptor in interface SAML2MetadataGenerator
      Returns:
      a EntityDescriptor object
    • signMetadata

      protected void signMetadata(org.opensaml.xmlsec.signature.SignableXMLObject descriptor)

      signMetadata.

      Parameters:
      descriptor - a EntityDescriptor object
    • generateMetadataExtensions

      protected org.opensaml.saml.saml2.metadata.Extensions generateMetadataExtensions()

      generateMetadataExtensions.

      Returns:
      a Extensions object
    • buildSPSSODescriptor

      protected org.opensaml.saml.saml2.metadata.SPSSODescriptor buildSPSSODescriptor()

      buildSPSSODescriptor.

      Returns:
      a SPSSODescriptor object
    • buildNameIDFormat

      protected Collection<org.opensaml.saml.saml2.metadata.NameIDFormat> buildNameIDFormat()

      buildNameIDFormat.

      Returns:
      a Collection object
    • getAssertionConsumerService

      protected org.opensaml.saml.saml2.metadata.AssertionConsumerService getAssertionConsumerService(String binding, int index, boolean isDefault)

      getAssertionConsumerService.

      Parameters:
      binding - a String object
      index - a int
      isDefault - a boolean
      Returns:
      a AssertionConsumerService object
    • getSingleLogoutService

      protected org.opensaml.saml.saml2.metadata.SingleLogoutService getSingleLogoutService(String binding)

      getSingleLogoutService.

      Parameters:
      binding - a String object
      Returns:
      a SingleLogoutService object
    • getKeyDescriptor

      protected org.opensaml.saml.saml2.metadata.KeyDescriptor getKeyDescriptor(org.opensaml.security.credential.UsageType type, org.opensaml.xmlsec.signature.KeyInfo key)

      getKeyDescriptor.

      Parameters:
      type - a UsageType object
      key - a KeyInfo object
      Returns:
      a KeyDescriptor object
    • getBlackListedSignatureSigningAlgorithms

      public List<String> getBlackListedSignatureSigningAlgorithms()

      Getter for the field blackListedSignatureSigningAlgorithms.

      Returns:
      a List object
    • getSignatureAlgorithms

      public List<String> getSignatureAlgorithms()

      Getter for the field signatureAlgorithms.

      Returns:
      a List object
    • getSignatureReferenceDigestMethods

      public List<String> getSignatureReferenceDigestMethods()

      Getter for the field signatureReferenceDigestMethods.

      Returns:
      a List object