I may not be able to change the SAML token. I will see if I can work around
it.

I implemented this the validator class.

import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.saml.ext.AssertionWrapper;
import org.apache.ws.security.validate.SamlAssertionValidator;

public class SAMLValidator extends SamlAssertionValidator {
        
        private static Logger logger = Logger.getLogger(SAMLValidator.class);
        
        @Override
        protected void validateAssertion(AssertionWrapper assertion) throws
WSSecurityException {
                // override the default behavior so that it will not validate 
against the
SAML2 schema
                logger.info("SAMLVadlidator called to NOT validate against 
SAML2 schema");
        }

}


Added the configuration to the interceptor so that it can be plugged into
the framework.

        <bean id="wss4jInInterceptor-ddc-service"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
                <constructor-arg>
                        <map>
                                <entry key="action" 
value="${SECURITY_DDC_ACTION}" />
                                <entry key="signaturePropFile"
                                
value="cms-files/cms-trusted-crypto-client-${SECURITY_RUNTIME_ENV}.properties"
/>
                                <entry key="decryptionPropFile"
                                
value="cms-files/cms-trusted-crypto-client-${SECURITY_RUNTIME_ENV}.properties"
/>
                                <entry key="encryptionKeyTransportAlgorithm"
value="${SECURITY_ENCRYPTION_KEY_TRANSPORT_ALGORITHM}" />
                                <entry key="signatureAlgorithm" 
value="${SECURITY_SIGNATURE_ALGORITHM}"
/>

                                <entry key="passwordCallbackRef" 
value-ref="keystoreCallbackHandler" />

                                <entry key="ws-security.saml2.validator" 
value-ref="samlValidator" />

                        </map>
                </constructor-arg>
        </bean>


But it didn't seem to get called. I didn't see any log in the log file and
the same exception was thrown.

Did I use the wrong entry key?

Thanks!




--
View this message in context: 
http://camel.465427.n5.nabble.com/add-SAML-TOKEN-to-SOAP-header-tp5749520p5749827.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to