Apache CXF API

org.apache.cxf.ws.security.wss4j
Class UsernameTokenInterceptor

java.lang.Object
  extended by org.apache.cxf.phase.AbstractPhaseInterceptor<SoapMessage>
      extended by org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor
          extended by org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor
              extended by org.apache.cxf.ws.security.wss4j.UsernameTokenInterceptor
All Implemented Interfaces:
SoapInterceptor, Interceptor<SoapMessage>, PhaseInterceptor<SoapMessage>

public class UsernameTokenInterceptor
extends AbstractTokenInterceptor


Constructor Summary
UsernameTokenInterceptor()
           
 
Method Summary
protected  void addToken(SoapMessage message)
           
protected  org.apache.wss4j.dom.message.WSSecUsernameToken addUsernameToken(SoapMessage message, org.apache.wss4j.policy.model.UsernameToken token)
           
protected  org.apache.wss4j.policy.model.UsernameToken assertTokens(SoapMessage message)
           
protected  SecurityContext createSecurityContext(Principal p, Subject subject)
           
protected  Subject createSubject(String name, String password, boolean isDigest, String nonce, String created)
          Create a Subject representing a current user and its roles.
protected  org.apache.wss4j.common.principal.UsernameTokenPrincipal getPrincipal(Element tokenElement, SoapMessage message)
          Deprecated. 
protected  boolean isWsiBSPCompliant(SoapMessage message)
           
protected  org.apache.wss4j.common.principal.UsernameTokenPrincipal parseTokenAndCreatePrincipal(Element tokenElement, boolean bspCompliant)
           
protected  void processToken(SoapMessage message)
           
protected  org.apache.wss4j.dom.WSSecurityEngineResult validateToken(Element tokenElement, SoapMessage message)
           
 
Methods inherited from class org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor
assertPolicy, assertPolicy, assertTokens, findSecurityHeader, getAllAssertionsByLocalname, getCallback, getPassword, getTokenStore, getUnderstoodHeaders, handleMessage, isTLSInUse, policyNotAsserted, policyNotAsserted
 
Methods inherited from class org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor
getFaultCodePrefix, getRoles, prepareStackTrace
 
Methods inherited from class org.apache.cxf.phase.AbstractPhaseInterceptor
addAfter, addAfter, addBefore, addBefore, getAdditionalInterceptors, getAfter, getBefore, getId, getPhase, handleFault, isGET, isRequestor, setAfter, setBefore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cxf.interceptor.Interceptor
handleFault
 

Constructor Detail

UsernameTokenInterceptor

public UsernameTokenInterceptor()
Method Detail

processToken

protected void processToken(SoapMessage message)
Specified by:
processToken in class AbstractTokenInterceptor

getPrincipal

@Deprecated
protected org.apache.wss4j.common.principal.UsernameTokenPrincipal getPrincipal(Element tokenElement,
                                                                                           SoapMessage message)
Deprecated. 


validateToken

protected org.apache.wss4j.dom.WSSecurityEngineResult validateToken(Element tokenElement,
                                                                    SoapMessage message)
                                                             throws org.apache.wss4j.common.ext.WSSecurityException,
                                                                    org.apache.xml.security.exceptions.Base64DecodingException
Throws:
org.apache.wss4j.common.ext.WSSecurityException
org.apache.xml.security.exceptions.Base64DecodingException

parseTokenAndCreatePrincipal

protected org.apache.wss4j.common.principal.UsernameTokenPrincipal parseTokenAndCreatePrincipal(Element tokenElement,
                                                                                                boolean bspCompliant)
                                                                                         throws org.apache.wss4j.common.ext.WSSecurityException,
                                                                                                org.apache.xml.security.exceptions.Base64DecodingException
Throws:
org.apache.wss4j.common.ext.WSSecurityException
org.apache.xml.security.exceptions.Base64DecodingException

isWsiBSPCompliant

protected boolean isWsiBSPCompliant(SoapMessage message)

createSecurityContext

protected SecurityContext createSecurityContext(Principal p,
                                                Subject subject)

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 - username
password - password
isDigest - true if a password digest is used
nonce - optional nonce
created - optional timestamp
Returns:
subject
Throws:
SecurityException

assertTokens

protected org.apache.wss4j.policy.model.UsernameToken assertTokens(SoapMessage message)
Specified by:
assertTokens in class AbstractTokenInterceptor

addToken

protected void addToken(SoapMessage message)
Specified by:
addToken in class AbstractTokenInterceptor

addUsernameToken

protected org.apache.wss4j.dom.message.WSSecUsernameToken addUsernameToken(SoapMessage message,
                                                                           org.apache.wss4j.policy.model.UsernameToken token)

Apache CXF API

Apache CXF