Package org.apache.wss4j.dom.message
Class WSSecSAMLToken
- java.lang.Object
-
- org.apache.wss4j.dom.message.WSSecBase
-
- org.apache.wss4j.dom.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
-
-
Field Summary
-
Fields inherited from class org.apache.wss4j.dom.message.WSSecBase
addWSUNamespace, attachmentCallbackHandler, callbackLookup, expandXopInclude, keyIdentifierType, password, storeBytesInAttachment, user
-
-
Constructor Summary
Constructors Constructor Description WSSecSAMLToken(WSSecHeader securityHeader)WSSecSAMLToken(Document doc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Documentbuild(SamlAssertionWrapper samlAssertion)Adds a newSAMLAssertionto a soap envelope.ElementgetElement()StringgetId()Get the id generated duringprepare().voidprepare(SamlAssertionWrapper samlAssertion)Creates a SAML token.voidprependToHeader()Prepends the SAML Assertion to the elements already in the Security header.-
Methods inherited from class org.apache.wss4j.dom.message.WSSecBase
clean, getDocument, getIdAllocator, getKeyIdentifierType, getParts, getSecurityHeader, getWsDocInfo, isExpandXopInclude, setAttachmentCallbackHandler, setBodyID, setCallbackLookup, setExpandXopInclude, setIdAllocator, setKeyIdentifierType, setStoreBytesInAttachment, setUserInfo, setWsDocInfo, setWsuId
-
-
-
-
Constructor Detail
-
WSSecSAMLToken
public WSSecSAMLToken(WSSecHeader securityHeader)
-
WSSecSAMLToken
public WSSecSAMLToken(Document doc)
-
-
Method Detail
-
prepare
public void prepare(SamlAssertionWrapper samlAssertion)
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 completeUsernameTokenis constructed.
-
prependToHeader
public void 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.
-
getElement
public Element getElement() throws WSSecurityException
- Throws:
WSSecurityException
-
getId
public String 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
public Document build(SamlAssertionWrapper samlAssertion)
Adds a newSAMLAssertionto a soap envelope. A completeSAMLAssertionis added to thewsse:Securityheader.- Parameters:
samlAssertion- TODO- Returns:
- Document with UsernameToken added
-
-