views:

94

answers:

2

I'm getting this exception when trying to access a JAX-WS webservice running on the same WAS 7.0 server as the client.

Caused by: javax.xml.ws.WebServiceException: java.io.IOException: Unable to deserialize the Subjects in this Context, cause: the realms do not match

I have a realm set up for user authentication and this call works fine with that realm disabled. Both server and client are running in the same cell.

My current thinking is that my web service is not providing any realm information at all, causing this problem, so I need to do something in my web service to provide a realm - but what? Even google-fu is failing me on this one!

A: 

The Realm is set in the LTPA token assigned to the call, and the realms of the client and server needs to match.

I.e. if client authenticates the user and sets and LTPA token with realm="Ldap1:389" then the server needs to have the same realm set. Or it needs to explicitly trust the given realm. This can be set up in WAS admin console, for an explanation of LTPA have a look here: http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/csec_ltpa.html

Pathduck
Both ws-client and ws-server are running on the same server with the same realm defined... must be something I need to do in the service?
Brabster
Oh I guess my answer wasn't that good. I'm not sure but from my experience if the webservice does no authentication it won't expect a LTPA token. But if one is sent it will still try to auth it, so maybe you can make the ws call not send a LTPA token? This must be done in the code I think?
Pathduck
A: 

It turned out to be that there needed to be a trust relationship between my local file-based admin realm and the realm I set up for my users to log on with.

WAS seems to do a lot of security gubbins under the covers, but turning on trace output for WSSecurity stuff helps shed light on problems.

Brabster