Package org.apache.ws.security.message
Class WSSecSAMLToken
java.lang.Object
org.apache.ws.security.message.WSSecBase
org.apache.ws.security.message.WSSecSAMLToken
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild
(Document doc, org.opensaml.SAMLAssertion assertion, WSSecHeader secHeader) Adds a newSAMLAssertion
to a soap envelope.getId()
Get the id generated duringprepare()
.void
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
-
Constructor Details
-
WSSecSAMLToken
public WSSecSAMLToken()Constructor.
-
-
Method Details
-
prepare
Creates a SAML token. The method prepares and initializes a WSSec UsernameToken structure after the relevant information was set. A Before callingprepare()
all parameters such as user, password, passwordType etc. must be set. A completeUsernameToken
is constructed.- Parameters:
doc
- The SOAP enevlope as W3C document
-
prependToHeader
Prepends the SAML Assertion to the elements already in the Security header. The method can be called any time afterprepare()
. 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
Get the id generated duringprepare()
. 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
Adds a newSAMLAssertion
to a soap envelope. A completeSAMLAssertion
is added to thewsse:Security
header.- Parameters:
doc
- The SOAP enevlope as W3C documentassertion
- TODO- Returns:
- Document with UsernameToken added
-