org.jboss.seam.security.external.saml
Class SamlEntityBean

java.lang.Object
  extended by org.jboss.seam.security.external.EntityBean
      extended by org.jboss.seam.security.external.saml.SamlEntityBean
All Implemented Interfaces:
EntityConfigurationApi, SamlEntityConfigurationApi
Direct Known Subclasses:
SamlIdpBean, SamlSpBean

public abstract class SamlEntityBean
extends EntityBean
implements SamlEntityConfigurationApi

Author:
Marcel Kolsteren

Field Summary
protected  JAXBContext metaDataJaxbContext
           
 
Fields inherited from class org.jboss.seam.security.external.EntityBean
hostName, port, protocol
 
Constructor Summary
SamlEntityBean()
           
 
Method Summary
abstract  SamlExternalEntity addExternalSamlEntity(Reader reader)
          This method can be used to add an external SAML entity that is trusted by the entity that is being configured.
protected  void addKeyDescriptorToMetaData(SSODescriptorType ssoDescriptor)
           
protected  void addNameIDFormatsToMetaData(SSODescriptorType idpSsoDescriptor)
           
protected  void addSloEndpointsToMetaData(SSODescriptorType ssoDescriptor)
           
 String getEntityId()
          The unique identification of this SAML Entity.
abstract  List<SamlExternalEntity> getExternalSamlEntities()
          Gets a list of all external entities that have been added previously by calling SamlEntityConfigurationApi.addExternalSamlEntity(java.io.Reader).
abstract  SamlExternalEntity getExternalSamlEntityByEntityId(String entityId)
          Gets the detailed of a trusted external entity, that has been added previously by calling SamlEntityConfigurationApi.addExternalSamlEntity(java.io.Reader).
abstract  SamlIdpOrSp getIdpOrSp()
           
 String getMetaDataURL()
          Gets the URL where the meta data of this entity is served.
 Map<String,SSODescriptorType> getMetaInfo()
           
 SamlBinding getPreferredBinding()
          The preferred SAML protocol binding.
 String getServiceURL(SamlServiceType service)
           
protected  SamlSigningKey getSigningKey()
           
 boolean isSingleLogoutMessagesSigned()
           
 boolean isWantSingleLogoutMessagesSigned()
           
protected  void readEntitiesDescriptor(Reader reader)
           
protected  EntityDescriptorType readEntityDescriptor(Reader metaInfoReader)
           
 void setEntityId(String entityId)
          
 void setPreferredBinding(SamlBinding preferredBinding)
          See SamlEntityConfigurationApi.getPreferredBinding()
 void setSigningKey(String keyStoreUrl, String keyStorePass, String signingKeyAlias, String signingKeyPass)
          Sets the key that is used to sign outgoing messages.
 void setSingleLogoutMessagesSigned(boolean singleLogoutMessagesSigned)
           
 void setWantSingleLogoutMessagesSigned(boolean wantSingleLogoutMessagesSigned)
           
abstract  void writeMetaData(Writer writer)
           
 
Methods inherited from class org.jboss.seam.security.external.EntityBean
createURL, getHostName, getPort, getProtocol, setHostName, setPort, setProtocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.seam.security.external.api.EntityConfigurationApi
getHostName, getPort, getProtocol, setHostName, setPort, setProtocol
 

Field Detail

metaDataJaxbContext

@Inject
protected JAXBContext metaDataJaxbContext
Constructor Detail

SamlEntityBean

public SamlEntityBean()
Method Detail

getServiceURL

public String getServiceURL(SamlServiceType service)

getMetaDataURL

public String getMetaDataURL()
Description copied from interface: SamlEntityConfigurationApi
Gets the URL where the meta data of this entity is served. Call this function only after configuration is complete (after you called other methods on this API that change the configuration).

Specified by:
getMetaDataURL in interface SamlEntityConfigurationApi
Returns:
the URL

setEntityId

public void setEntityId(String entityId)
Description copied from interface: SamlEntityConfigurationApi

Specified by:
setEntityId in interface SamlEntityConfigurationApi

getEntityId

public String getEntityId()
Description copied from interface: SamlEntityConfigurationApi
The unique identification of this SAML Entity. Typically, this is "https://www.your-domain.com".

Specified by:
getEntityId in interface SamlEntityConfigurationApi
Returns:
the entity ID

getSigningKey

protected SamlSigningKey getSigningKey()

setSigningKey

public void setSigningKey(String keyStoreUrl,
                          String keyStorePass,
                          String signingKeyAlias,
                          String signingKeyPass)
Description copied from interface: SamlEntityConfigurationApi
Sets the key that is used to sign outgoing messages. Remark that in production deployments, the key store and the passwords giving access to it need to be well secured.

Specified by:
setSigningKey in interface SamlEntityConfigurationApi
Parameters:
keyStoreUrl - URL of the key store, which must have Java Key Store (JKS) format; if it starts with "classpath://", the keystore will be read from the given location within the classpath
keyStorePass - the password giving access to the key store
signingKeyAlias - the alias under which the private key is stored that needs to be used for signing; the private key must be either a DSA or an RSA key
signingKeyPass - the password that gives access to the private key

isSingleLogoutMessagesSigned

public boolean isSingleLogoutMessagesSigned()

setSingleLogoutMessagesSigned

public void setSingleLogoutMessagesSigned(boolean singleLogoutMessagesSigned)

isWantSingleLogoutMessagesSigned

public boolean isWantSingleLogoutMessagesSigned()

setWantSingleLogoutMessagesSigned

public void setWantSingleLogoutMessagesSigned(boolean wantSingleLogoutMessagesSigned)

getIdpOrSp

public abstract SamlIdpOrSp getIdpOrSp()

getExternalSamlEntityByEntityId

public abstract SamlExternalEntity getExternalSamlEntityByEntityId(String entityId)
Description copied from interface: SamlEntityConfigurationApi
Gets the detailed of a trusted external entity, that has been added previously by calling SamlEntityConfigurationApi.addExternalSamlEntity(java.io.Reader).

Specified by:
getExternalSamlEntityByEntityId in interface SamlEntityConfigurationApi
Parameters:
entityId - the id of the entity
Returns:
an object containing the properties of the entity

addExternalSamlEntity

public abstract SamlExternalEntity addExternalSamlEntity(Reader reader)
Description copied from interface: SamlEntityConfigurationApi
This method can be used to add an external SAML entity that is trusted by the entity that is being configured. If the entity that is being configured is an identity provider, this method can be used for adding trusted service providers, and vice versa. The reader must contain a UTF-8 encoded XML-file with the meta information of the entity that needs to be added. When this method returns, the configured entity trusts the added entity (has been added to the "circle of trust"). Remark that the meta data of the configured entity also needs to be loaded in the external entity. How this is done is out of scope for this API, but the needed meta information is served at the URL provided by SamlEntityConfigurationApi.getMetaDataURL().

Specified by:
addExternalSamlEntity in interface SamlEntityConfigurationApi
Parameters:
reader - reader that reads the meta information of the entry that needs to be added
Returns:
the contents of the external entity (extracted from the meta information)

getExternalSamlEntities

public abstract List<SamlExternalEntity> getExternalSamlEntities()
Description copied from interface: SamlEntityConfigurationApi
Gets a list of all external entities that have been added previously by calling SamlEntityConfigurationApi.addExternalSamlEntity(java.io.Reader).

Specified by:
getExternalSamlEntities in interface SamlEntityConfigurationApi
Returns:
the list

readEntitiesDescriptor

protected void readEntitiesDescriptor(Reader reader)

getMetaInfo

public Map<String,SSODescriptorType> getMetaInfo()

readEntityDescriptor

protected EntityDescriptorType readEntityDescriptor(Reader metaInfoReader)

writeMetaData

public abstract void writeMetaData(Writer writer)

addKeyDescriptorToMetaData

protected void addKeyDescriptorToMetaData(SSODescriptorType ssoDescriptor)

addSloEndpointsToMetaData

protected void addSloEndpointsToMetaData(SSODescriptorType ssoDescriptor)

addNameIDFormatsToMetaData

protected void addNameIDFormatsToMetaData(SSODescriptorType idpSsoDescriptor)

getPreferredBinding

public SamlBinding getPreferredBinding()
Description copied from interface: SamlEntityConfigurationApi
The preferred SAML protocol binding. By default, it is SamlBinding.HTTP_Post

Specified by:
getPreferredBinding in interface SamlEntityConfigurationApi
Returns:
the preferred binding

setPreferredBinding

public void setPreferredBinding(SamlBinding preferredBinding)
Description copied from interface: SamlEntityConfigurationApi
See SamlEntityConfigurationApi.getPreferredBinding()

Specified by:
setPreferredBinding in interface SamlEntityConfigurationApi


Copyright © 2011 Seam Framework. All Rights Reserved.