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>
public class UsernameTokenInterceptor
- extends AbstractTokenInterceptor
| 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 |
UsernameTokenInterceptor
public UsernameTokenInterceptor()
processToken
protected void processToken(org.apache.cxf.binding.soap.SoapMessage message)
- Specified by:
processToken in class AbstractTokenInterceptor
getPrincipal
protected org.apache.ws.security.WSUsernameTokenPrincipal getPrincipal(Element tokenElement,
org.apache.cxf.binding.soap.SoapMessage message)
throws org.apache.ws.security.WSSecurityException
- Throws:
org.apache.ws.security.WSSecurityException
parseTokenAndCreatePrincipal
protected org.apache.ws.security.WSUsernameTokenPrincipal parseTokenAndCreatePrincipal(Element tokenElement,
boolean bspCompliant)
throws org.apache.ws.security.WSSecurityException
- Throws:
org.apache.ws.security.WSSecurityException
isWsiBSPCompliant
protected boolean isWsiBSPCompliant(org.apache.cxf.binding.soap.SoapMessage message)
createSecurityContext
protected org.apache.cxf.security.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 - usernamepassword - passwordisDigest - true if a password digest is usednonce - optional noncecreated - optional timestamp
- Returns:
- subject
- Throws:
SecurityException
assertTokens
protected UsernameToken assertTokens(org.apache.cxf.binding.soap.SoapMessage message)
- Specified by:
assertTokens in class AbstractTokenInterceptor
addToken
protected void addToken(org.apache.cxf.binding.soap.SoapMessage message)
- Specified by:
addToken in class AbstractTokenInterceptor
addUsernameToken
protected org.apache.ws.security.message.WSSecUsernameToken addUsernameToken(org.apache.cxf.binding.soap.SoapMessage message,
UsernameToken token)
Apache CXF