Class 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
    • Constructor Detail

      • UsernameTokenInterceptor

        public UsernameTokenInterceptor()
    • Method Detail

      • 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.WSSecurityException
        org.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.WSSecurityException
        org.apache.xml.security.exceptions.Base64DecodingException
      • 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 - 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​(org.apache.cxf.binding.soap.SoapMessage message)
        Specified by:
        assertTokens in class AbstractTokenInterceptor
      • 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)