org.opensaml.saml1.binding.decoding
Class BaseSAML1MessageDecoder

java.lang.Object
  extended by org.opensaml.ws.message.decoder.BaseMessageDecoder
      extended by org.opensaml.common.binding.decoding.BaseSAMLMessageDecoder
          extended by org.opensaml.saml1.binding.decoding.BaseSAML1MessageDecoder
All Implemented Interfaces:
SAMLMessageDecoder, MessageDecoder
Direct Known Subclasses:
HTTPArtifactDecoder, HTTPPostDecoder, HTTPSOAP11Decoder

public abstract class BaseSAML1MessageDecoder
extends BaseSAMLMessageDecoder

Base class for SAML 1 message decoders.


Field Summary
private  SAMLArtifactMap artifactMap
          Map used to map artifacts to SAML.
private  org.slf4j.Logger log
          Class logger.
private  boolean useQueryResourceAsEntityId
          Whether to use the resource of an attribute query as the relying party entity ID.
 
Constructor Summary
BaseSAML1MessageDecoder()
          Constructor.
BaseSAML1MessageDecoder(ParserPool pool)
          Constructor.
BaseSAML1MessageDecoder(SAMLArtifactMap map)
          Deprecated.  
BaseSAML1MessageDecoder(SAMLArtifactMap map, ParserPool pool)
          Deprecated.  
 
Method Summary
 void decode(MessageContext messageContext)
          
protected  void extractAssertionArtifactInfo(SAMLMessageContext messageContext, List<AssertionArtifact> artifacts)
          Extract the issuer, and populate message context, as the relying party corresponding to the first AssertionArtifact in the message.
protected  void extractAttributeQueryInfo(SAMLMessageContext messageContext, AttributeQuery query)
          Extract the issuer, and populate message context, from the Resource attribute of the Attribute query if useQueryResourceAsEntityId is true.
protected  void extractAuthorizationDecisionQueryInfo(SAMLMessageContext messageContext, AuthorizationDecisionQuery query)
          Extract the issuer, and populate message context, from the Resource attribute of the AuthorizationDecisionQuery query if useQueryResourceAsEntityId is true.
protected  void extractRequestInfo(SAMLMessageContext messageContext, RequestAbstractType abstractRequest)
          Extract information from a SAML RequestAbstractType message.
protected  void extractResponseInfo(SAMLMessageContext messageContext, Response response)
          Extract information from a SAML StatusResponse message.
 SAMLArtifactMap getArtifactMap()
          Gets the artifact map used to retrieve SAML information from an artifact.
protected  String getIntendedDestinationEndpointURI(SAMLMessageContext samlMsgCtx)
          Extract the message information which indicates to what receiver endpoint URI the SAML message was intended to be delivered.
 boolean getUseQueryResourceAsEntityId()
          Gets whether to use the Resource attribute of some SAML 1 queries as the entity ID of the inbound message issuer.
protected  void populateMessageContext(SAMLMessageContext messageContext)
          Populates the message context with the message ID, issue instant, and issuer as well as the peer's entity descriptor if a metadata provider is present in the message context and the peer's role descriptor if its entity descriptor was retrieved and the message context has a populated peer role name.
protected  void populateMessageIdIssueInstantIssuer(SAMLMessageContext messageContext)
          Extracts the message ID, issue instant, and issuer from the incoming SAML message and populates the message context with it.
protected  void populateRelyingPartyMetadata(SAMLMessageContext messageContext)
          Populates the peer's entity metadata if a metadata provide is present in the message context.
 void setUseQueryResourceAsEntityId(boolean useResource)
          Sets whether to use the Resource attribute of some SAML 1 queries as the entity ID of the inbound message issuer.
 
Methods inherited from class org.opensaml.common.binding.decoding.BaseSAMLMessageDecoder
checkEndpointURI, compareEndpointURIs, getActualReceiverEndpointURI, getURIComparator, isIntendedDestinationEndpointURIRequired, isMessageSigned, setURIComparator
 
Methods inherited from class org.opensaml.ws.message.decoder.BaseMessageDecoder
doDecode, getParserPool, logDecodedMessage, processSecurityPolicy, setParserPool, unmarshallMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensaml.common.binding.decoding.SAMLMessageDecoder
getBindingURI
 

Field Detail

log

private final org.slf4j.Logger log
Class logger.


artifactMap

private SAMLArtifactMap artifactMap
Map used to map artifacts to SAML.


useQueryResourceAsEntityId

private boolean useQueryResourceAsEntityId
Whether to use the resource of an attribute query as the relying party entity ID.

Constructor Detail

BaseSAML1MessageDecoder

public BaseSAML1MessageDecoder()
Constructor.


BaseSAML1MessageDecoder

public BaseSAML1MessageDecoder(ParserPool pool)
Constructor.

Parameters:
pool - parser pool used to deserialize messages

BaseSAML1MessageDecoder

public BaseSAML1MessageDecoder(SAMLArtifactMap map)
Deprecated. 

Constructor.

Parameters:
map - used to map artifacts to SAML

BaseSAML1MessageDecoder

public BaseSAML1MessageDecoder(SAMLArtifactMap map,
                               ParserPool pool)
Deprecated. 

Constructor.

Parameters:
map - used to map artifacts to SAML
pool - parser pool used to deserialize messages
Method Detail

decode

public void decode(MessageContext messageContext)
            throws MessageDecodingException,
                   SecurityException

Specified by:
decode in interface MessageDecoder
Overrides:
decode in class BaseMessageDecoder
Throws:
MessageDecodingException
SecurityException

getArtifactMap

public SAMLArtifactMap getArtifactMap()
Gets the artifact map used to retrieve SAML information from an artifact.

Returns:
artifact map used to retrieve SAML information from an artifact

getUseQueryResourceAsEntityId

public boolean getUseQueryResourceAsEntityId()
Gets whether to use the Resource attribute of some SAML 1 queries as the entity ID of the inbound message issuer.

Returns:
whether to use the Resource attribute of some SAML 1 queries as the entity ID of the inbound message issuer

setUseQueryResourceAsEntityId

public void setUseQueryResourceAsEntityId(boolean useResource)
Sets whether to use the Resource attribute of some SAML 1 queries as the entity ID of the inbound message issuer.

Parameters:
useResource - whether to use the Resource attribute of some SAML 1 queries as the entity ID of the inbound message issuer

populateMessageContext

protected void populateMessageContext(SAMLMessageContext messageContext)
                               throws MessageDecodingException
Populates the message context with the message ID, issue instant, and issuer as well as the peer's entity descriptor if a metadata provider is present in the message context and the peer's role descriptor if its entity descriptor was retrieved and the message context has a populated peer role name.

Parameters:
messageContext - message context to populate
Throws:
MessageDecodingException - thrown if there is a problem populating the message context

populateMessageIdIssueInstantIssuer

protected void populateMessageIdIssueInstantIssuer(SAMLMessageContext messageContext)
                                            throws MessageDecodingException
Extracts the message ID, issue instant, and issuer from the incoming SAML message and populates the message context with it.

Parameters:
messageContext - current message context
Throws:
MessageDecodingException - thrown if there is a problem populating the message context

extractRequestInfo

protected void extractRequestInfo(SAMLMessageContext messageContext,
                                  RequestAbstractType abstractRequest)
Extract information from a SAML RequestAbstractType message.

Parameters:
messageContext - current message context
abstractRequest - the SAML message to process

extractAttributeQueryInfo

protected void extractAttributeQueryInfo(SAMLMessageContext messageContext,
                                         AttributeQuery query)
Extract the issuer, and populate message context, from the Resource attribute of the Attribute query if useQueryResourceAsEntityId is true.

Parameters:
messageContext - current message context
query - query to extract resource name from

extractAuthorizationDecisionQueryInfo

protected void extractAuthorizationDecisionQueryInfo(SAMLMessageContext messageContext,
                                                     AuthorizationDecisionQuery query)
Extract the issuer, and populate message context, from the Resource attribute of the AuthorizationDecisionQuery query if useQueryResourceAsEntityId is true.

Parameters:
messageContext - current message context
query - query to extract resource name from

extractAssertionArtifactInfo

protected void extractAssertionArtifactInfo(SAMLMessageContext messageContext,
                                            List<AssertionArtifact> artifacts)
Extract the issuer, and populate message context, as the relying party corresponding to the first AssertionArtifact in the message.

Parameters:
messageContext - current message context
artifacts - AssertionArtifacts in the request

extractResponseInfo

protected void extractResponseInfo(SAMLMessageContext messageContext,
                                   Response response)
                            throws MessageDecodingException
Extract information from a SAML StatusResponse message.

Parameters:
messageContext - current message context
response - the SAML message to process
Throws:
MessageDecodingException - thrown if the assertions within the response contain differening issuer IDs

populateRelyingPartyMetadata

protected void populateRelyingPartyMetadata(SAMLMessageContext messageContext)
                                     throws MessageDecodingException
Populates the peer's entity metadata if a metadata provide is present in the message context. Populates the peer's role descriptor if the entity metadata was available and the role name is present in the message context.

Parameters:
messageContext - current message context
Throws:
MessageDecodingException - thrown if there is a problem populating the message context

getIntendedDestinationEndpointURI

protected String getIntendedDestinationEndpointURI(SAMLMessageContext samlMsgCtx)
                                            throws MessageDecodingException
Extract the message information which indicates to what receiver endpoint URI the SAML message was intended to be delivered.

This SAML 1-specific implementation extracts the value of the ResponseAbstractType protocol message Recipient attribute.

Specified by:
getIntendedDestinationEndpointURI in class BaseSAMLMessageDecoder
Parameters:
samlMsgCtx - the SAML message context being processed
Returns:
the value of the intended destination endpoint URI, or null if not present or empty
Throws:
MessageDecodingException - thrown if the message is not an instance of SAML message that could be processed by the decoder


Copyright © 1999-2013. All Rights Reserved.