org.apache.ws.security.message
Class WSSecSAMLToken

java.lang.Object
  extended byorg.apache.ws.security.message.WSSecBase
      extended byorg.apache.ws.security.message.WSSecSAMLToken

public class WSSecSAMLToken
extends WSSecBase

Builds a WS SAML Assertion and inserts it into the SOAP Envelope. Refer to the WS specification, SAML Token profile

Author:
Davanum Srinivas (dims@yahoo.com).

Field Summary
 
Fields inherited from class org.apache.ws.security.message.WSSecBase
doDebug, keyIdentifierType, parts, password, user, wssConfig
 
Constructor Summary
WSSecSAMLToken()
          Constructor.
 
Method Summary
 org.w3c.dom.Document build(org.w3c.dom.Document doc, org.opensaml.SAMLAssertion assertion, WSSecHeader secHeader)
          Adds a new SAMLAssertion to a soap envelope.
 java.lang.String getId()
          Get the id generated during prepare().
 void prepare(org.w3c.dom.Document doc, org.opensaml.SAMLAssertion assertion)
          Creates a SAML token.
 void prependToHeader(WSSecHeader secHeader)
          Prepends the SAML Assertion to the elements already in the Security header.
 
Methods inherited from class org.apache.ws.security.message.WSSecBase
getKeyIdentifierType, setBodyID, setKeyIdentifierType, setParts, setUserInfo, setWsConfig, setWsuId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSSecSAMLToken

public WSSecSAMLToken()
Constructor.

Method Detail

prepare

public void prepare(org.w3c.dom.Document doc,
                    org.opensaml.SAMLAssertion assertion)
Creates a SAML token. The method prepares and initializes a WSSec UsernameToken structure after the relevant information was set. A Before calling prepare() all parameters such as user, password, passwordType etc. must be set. A complete UsernameToken is constructed.

Parameters:
doc - The SOAP envelope as W3C document

prependToHeader

public void prependToHeader(WSSecHeader secHeader)
Prepends the SAML Assertion to the elements already in the Security header. The method can be called any time after prepare(). This allows to insert the SAML assertion at any position in the Security header.

Parameters:
secHeader - The security header that holds the Signature element.

getId

public java.lang.String getId()
Get the id generated during prepare(). Returns the the value of wsu:Id attribute of this Timestamp.

Returns:
Return the wsu:Id of this token or null if prepareToken() was not called before.

build

public org.w3c.dom.Document build(org.w3c.dom.Document doc,
                                  org.opensaml.SAMLAssertion assertion,
                                  WSSecHeader secHeader)
Adds a new SAMLAssertion to a soap envelope.

A complete SAMLAssertion is added to the wsse:Security header.

Parameters:
doc - The SOAP envelope as W3C document
assertion - TODO
Returns:
Document with UsernameToken added


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.