Authenticating using LTPA on Websphere App Server 5.x
Posted: Sep 18, 2005 9:24 AM
Advertisement
Hi, I have an upstream (client) webservice which has an authenticated user, who needs to access a downstream (server) webservice through LTPA. The code that calls the downstream (server) webservice is as follows - com.ibm.websphere.security.auth.WSSubject.doAs(com.ibm.websphere.security.auth. WSSubject.getRunAsSubject(),new java.security.PrivilegedAction() { public Object run() { try { LoginContext lc=new LoginContext("WSLogin",new WSCallbackHandlerImpl("po1","po1")); lc.login(); new WebserviceProxy().serverMethod(); lc.logout(); } catch (Exception e) { e.printStackTrace(); } return null; }//run }); The client deployment descriptors are as under - ibm-webservices-bnd.xmi ----- <?xml version="1.0" encoding="UTF-8"?> <com.ibm.etools.webservice.wscbnd:ClientBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:com.ibm.etools.webservice.wscbnd="http://www.ibm.com/websphere/appserver/ schemas/5.0.2/wscbnd.xmi" xmi:id="ClientBinding_1126742947723"> <serviceRefs xmi:id="ServiceRef_1126746905927" serviceRefLink="WebserviceService"> <portQnameBindings xmi:id="PortQnameBinding_1126746905927" portQnameLocalNameLink="Webservice"> <securityRequestSenderBindingConfig xmi:id="SecurityRequestSenderBindingConfig_1126823102203"> <loginBinding authMethod="LTPA" callbackHandler="com.ibm.wsspi.wssecurity.auth.callback.LTPATokenCallbackHandle r"> <tokenValueType uri="http://www.ibm.com/websphere/appserver/tokentype/5.0.2" localName="LTPA"/> <basicAuth userid="po1" password="{xor}LzBu"/> </loginBinding> </securityRequestSenderBindingConfig> </portQnameBindings> </serviceRefs> </com.ibm.etools.webservice.wscbnd:ClientBinding> ibm-webservices-ext.xmi ---- <?xml version="1.0" encoding="UTF-8"?> <com.ibm.etools.webservice.wscext:WsClientExtension xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:com.ibm.etools.webservice.wscext="http://www.ibm.com/websphere/appserver/ schemas/5.0.2/wscext.xmi" xmi:id="WsClientExtension_1126742947754"> <serviceRefs xmi:id="ServiceRef_1126823102109" serviceRefLink="WebserviceService"> <portQnameBindings xmi:id="PortQnameBinding_1126823102109" portQnameNamespaceLink="http://svc.web.psi" portQnameLocalNameLink="Webservice"> <clientServiceConfig xmi:id="ClientServiceConfig_1126823102109"> <securityRequestSenderServiceConfig xmi:id="SecurityRequestSenderServiceConfig_1126823102109"> <integrity xmi:id="Integrity_1126885539593"/> <loginConfig xmi:id="LoginConfig_1126823102109" authMethod="LTPA"/> <addCreatedTimeStamp xmi:id="AddCreatedTimeStamp_1126823111203" flag="true"/> </securityRequestSenderServiceConfig> <securityResponseReceiverServiceConfig xmi:id="SecurityResponseReceiverServiceConfig_1126823102109"> <addReceivedTimeStamp xmi:id="AddReceivedTimestamp_1126823102109" flag="true"/> </securityResponseReceiverServiceConfig> </clientServiceConfig> </portQnameBindings> </serviceRefs> </com.ibm.etools.webservice.wscext:WsClientExtension> ; and webservices.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE webservicesclient PUBLIC "-//IBM Corporation, Inc.//DTD J2EE Web services client 1.0//EN" "http://www.ibm.com/webservices/dtd/j2ee_web_services_client_1_0.dtd"> <webservicesclient id="WebServicesClient_1126743846470"> <service-ref id="ServiceRef_1126746905740"> <description>WSDL Service WebserviceService</description> <service-ref-name>WebserviceService</service-ref-name> <service-interface>psi.web.svc.WebserviceService</service-interface> ; <wsdl-file>WEB-INF/wsdl/Webservice.wsdl</wsdl-file> <jaxrpc-mapping-file>WEB-INF/Webservice_mapping.xml</jaxrpc-mapping-fi le> <service-qname id="ServiceQname_1126746905740"> <namespaceURI>http://svc.web.psi</namespaceURI> <localpart>WebserviceService</localpart> </service-qname> <port-component-ref id="PortComponentRef_1126746905740"> <service-endpoint-interface>psi.web.svc.Webservice</service-endpoint-i nterface> </port-component-ref> </service-ref> </webservicesclient> I am confident that the downstream (server) webservice is configured properly. Now the problem is that the LTPA <wsse:BinarySecurityToken> security token is not generated and is not part of the SOAP message. so I get a service fault - faultCode: {http://schemas.xmlsoap.org/ws/2003/06/secext }FailedAuthentication faultString: WSEC5075E: No security token found which satisfies any one of AuthMethods. faultActor: null faultDetail: stackTrace: com.ibm.wsspi.wssecurity.SoapSecurityException: WSEC5075E: No security token found which satisfies any one of AuthMethods. at com.ibm.wsspi.wssecurity.SoapSecurityException.format(SoapSecurityException.jav a:135) can anybody give me pointers to what may be wrong here? thanks in anticipation, praveen