Package org.apache.cxf.ws.security.wss4j
Class UsernameTokenInterceptor
java.lang.Object
org.apache.cxf.phase.AbstractPhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>
org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor
org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor
org.apache.cxf.ws.security.wss4j.UsernameTokenInterceptor
- All Implemented Interfaces:
org.apache.cxf.binding.soap.interceptor.SoapInterceptor,org.apache.cxf.interceptor.Interceptor<org.apache.cxf.binding.soap.SoapMessage>,org.apache.cxf.phase.PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToken(org.apache.cxf.binding.soap.SoapMessage message) protected org.apache.wss4j.dom.message.WSSecUsernameTokenaddUsernameToken(org.apache.cxf.binding.soap.SoapMessage message, Document doc, org.apache.wss4j.policy.model.UsernameToken token) protected org.apache.wss4j.policy.model.UsernameTokenassertTokens(org.apache.cxf.binding.soap.SoapMessage message) protected org.apache.cxf.security.SecurityContextcreateSecurityContext(Principal p, Subject subject) protected SubjectcreateSubject(String name, String password, boolean isDigest, String nonce, String created) Create a Subject representing a current user and its roles.protected booleanisWsiBSPCompliant(org.apache.cxf.binding.soap.SoapMessage message) protected org.apache.wss4j.common.principal.UsernameTokenPrincipalparseTokenAndCreatePrincipal(Element tokenElement, boolean bspCompliant, boolean allowNamespaceQualifiedPWDTypes) protected voidprocessToken(org.apache.cxf.binding.soap.SoapMessage message) protected org.apache.wss4j.dom.engine.WSSecurityEngineResultvalidateToken(Element tokenElement, org.apache.cxf.binding.soap.SoapMessage message) Methods inherited from class org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor
assertTokens, findSecurityHeader, getPassword, getTokenStore, getUnderstoodHeaders, handleMessage, isTLSInUse, policyNotAsserted, policyNotAssertedMethods inherited from class org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor
getFaultCodePrefix, getRoles, prepareStackTraceMethods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor
addAfter, addAfter, addBefore, addBefore, getAdditionalInterceptors, getAfter, getBefore, getId, getPhase, handleFault, isGET, isRequestor, setAfter, setBeforeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cxf.interceptor.Interceptor
handleFault
-
Constructor Details
-
UsernameTokenInterceptor
public UsernameTokenInterceptor()
-
-
Method Details
-
processToken
protected void processToken(org.apache.cxf.binding.soap.SoapMessage message) - Specified by:
processTokenin classAbstractTokenInterceptor
-
validateToken
protected org.apache.wss4j.dom.engine.WSSecurityEngineResult validateToken(Element tokenElement, org.apache.cxf.binding.soap.SoapMessage message) throws org.apache.wss4j.common.ext.WSSecurityException, org.apache.xml.security.exceptions.Base64DecodingException - Throws:
org.apache.wss4j.common.ext.WSSecurityExceptionorg.apache.xml.security.exceptions.Base64DecodingException
-
parseTokenAndCreatePrincipal
protected org.apache.wss4j.common.principal.UsernameTokenPrincipal parseTokenAndCreatePrincipal(Element tokenElement, boolean bspCompliant, boolean allowNamespaceQualifiedPWDTypes) throws org.apache.wss4j.common.ext.WSSecurityException, org.apache.xml.security.exceptions.Base64DecodingException - Throws:
org.apache.wss4j.common.ext.WSSecurityExceptionorg.apache.xml.security.exceptions.Base64DecodingException
-
isWsiBSPCompliant
protected boolean isWsiBSPCompliant(org.apache.cxf.binding.soap.SoapMessage message) -
createSecurityContext
-
createSubject
protected Subject createSubject(String name, String password, boolean isDigest, String nonce, String created) throws SecurityException Create a Subject representing a current user and its roles. This Subject is expected to contain at least one Principal representing a user and optionally followed by one or more principal Groups this user is a member of.- Parameters:
name- usernamepassword- passwordisDigest- true if a password digest is usednonce- optional noncecreated- optional timestamp- Returns:
- subject
- Throws:
SecurityException
-
assertTokens
protected org.apache.wss4j.policy.model.UsernameToken assertTokens(org.apache.cxf.binding.soap.SoapMessage message) - Specified by:
assertTokensin classAbstractTokenInterceptor
-
addToken
protected void addToken(org.apache.cxf.binding.soap.SoapMessage message) - Specified by:
addTokenin classAbstractTokenInterceptor
-
addUsernameToken
protected org.apache.wss4j.dom.message.WSSecUsernameToken addUsernameToken(org.apache.cxf.binding.soap.SoapMessage message, Document doc, org.apache.wss4j.policy.model.UsernameToken token)
-