Hi George,
Can this issue be due to a case where somehow, the classloader of the
callback instance passed into the callback handler is different from
the classloader that loaded the callback handler?
Thanks,
Ruchith
On 1/19/07, George Cowe <[EMAIL PROTECTED]> wrote:
Hi
I am using WSS4J 1.5.1 with Axis 1.3 and having a problem signing a response
from a web service.
The axis client successfully signs a SOAP message and sends it to server side
axis service which successfully verifies it. The axis service then attempts to
sign the response and gets the following error.
WSHandler: password callback failed; nested exception is:
javax.security.auth.callback.UnsupportedCallbackException: Unrecognized
Callback; nested exception is:
org.apache.ws.security.WSSecurityException: WSHandler: password
callback failed; nested exception is:
javax.security.auth.callback.UnsupportedCallbackException: Unrecognized
Callback
I'm using the same keystore and same private key to sign message on both client
and server side.
Callback program is very simple and used on both client and server side. Works
ok on client side, but throws the Unrecognized Callback exception on server
side.
public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof WSPasswordCallback) {
WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
pc.setPassword("george");
} else {
throw new UnsupportedCallbackException(
callbacks[i], "Unrecognized Callback");
}
}
The same crypto properties file is used on client and server :-
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=pkcs12
org.apache.ws.security.crypto.merlin.keystore.password=george
org.apache.ws.security.crypto.merlin.keystore.alias=55ce69717372baf27f2862857a9dd2db_50e417e0-e461-474b-96e2-077b80325612
org.apache.ws.security.crypto.merlin.alias.password=george
org.apache.ws.security.crypto.merlin.file=george-origo.pfx
The server wsdd looks like this :-
<deployment name="CEBondSingleContractSecureHandlerService"
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
<handler name="DoSecurityReceiver"
type="java:org.apache.ws.axis.security.WSDoAllReceiver" >
<parameter name="action" value="Signature"/>
<parameter name="signaturePropFile" value="crypto.properties"/>
<parameter name="signatureKeyIdentifier"
value="DirectReference"/>
<parameter name="user"
value="55ce69717372baf27f2862857a9dd2db_50e417e0-e461-474b-96e2-077b80325612"/>
<parameter name="passwordCallbackClass"
value="com.origoservices.keystore.util.PasswordProvider" />
<parameter name="mustUnderstand" value="0" />
</handler>
<handler name="DoSecuritySender"
type="java:org.apache.ws.axis.security.WSDoAllSender" >
<parameter name="action" value="Signature"/>
<parameter name="signaturePropFile" value="crypto.properties"/>
<parameter name="signatureKeyIdentifier"
value="DirectReference"/>
<parameter name="user"
value="55ce69717372baf27f2862857a9dd2db_50e417e0-e461-474b-96e2-077b80325612"/>
<parameter name="passwordCallbackClass"
value="com.origoservices.keystore.util.PasswordProvider" />
<parameter name="mustUnderstand" value="0" />
</handler>
<service name="CEBondSingleContractSecureHandlerService"
style="message">
<requestFlow>
<handler type="DoSecurityReceiver"/>
</requestFlow>
<responseFlow>
<handler type="DoSecuritySender"/>
</responseFlow>
<parameter name="allowedMethods" value="*"/>
<parameter name="className"
value="com.origoservices.secure.ws.MsgProcessor"/>
</service>
</deployment>
The axis client is using jdk 1.5 for the java runtime, the server side is
Tomcat 5.0.28 which too is using the same jdk for its java runtime.
Can anyone explain why an exception occurs in the passwordCallbackClass on
server side?
Any help much appreciated.
Thanks
George
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
www.ruchith.org
www.wso2.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]