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,Interceptor<org.apache.cxf.binding.soap.SoapMessage>,PhaseInterceptor<org.apache.cxf.binding.soap.SoapMessage>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToken(org.apache.cxf.binding.soap.SoapMessage message) protected WSSecUsernameTokenaddUsernameToken(org.apache.cxf.binding.soap.SoapMessage message, Document doc, UsernameToken token) protected UsernameTokenassertTokens(org.apache.cxf.binding.soap.SoapMessage message) protected 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 UsernameTokenPrincipalparseTokenAndCreatePrincipal(Element tokenElement, boolean bspCompliant, boolean allowNamespaceQualifiedPWDTypes) protected voidprocessToken(org.apache.cxf.binding.soap.SoapMessage message) protected 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 WSSecurityEngineResult validateToken(Element tokenElement, org.apache.cxf.binding.soap.SoapMessage message) throws WSSecurityException, org.apache.xml.security.exceptions.Base64DecodingException - Throws:
WSSecurityExceptionorg.apache.xml.security.exceptions.Base64DecodingException
-
parseTokenAndCreatePrincipal
protected UsernameTokenPrincipal parseTokenAndCreatePrincipal(Element tokenElement, boolean bspCompliant, boolean allowNamespaceQualifiedPWDTypes) throws WSSecurityException, org.apache.xml.security.exceptions.Base64DecodingException - Throws:
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
- Specified by:
assertTokensin classAbstractTokenInterceptor
-
addToken
protected void addToken(org.apache.cxf.binding.soap.SoapMessage message) - Specified by:
addTokenin classAbstractTokenInterceptor
-
addUsernameToken
protected WSSecUsernameToken addUsernameToken(org.apache.cxf.binding.soap.SoapMessage message, Document doc, UsernameToken token)
-