Emmanuel Gleizer
Emmanuel Gleizer

Reputation: 2018

SOAP header for authentication in Notes/Domino

I need to consume a WS that requires client (machine) certificate. More precisely it uses WS-Security : SOAP Message Security, WS-Security : X.509 Certificate Token Profile as defined by http://docs.oasis-open.org/wss-m/wss/v1.1.1/os/wss-SOAPMessageSecurity-v1.1.1-os.html

Using the native consumer, Domino don't add (magically) the authentication in the SOAP header. Now how I'm supposed to do add the security in header? Ideally in LotusScript...
I don't see anyway to embed the Consumer in my own header or enrich the existing consumer. I join the IBM response on this.
So my question:

IBM response:

We understand that you are attempting to use SOAP header for authentication. Unfortunately this is currently not supported. For your reference, we have at least two Enhancement Requests (that I could find in this area) that are related to this topic:
SPR # SODY9H6BTM: Creating Your Own Soap Objects Does Not Support Client Certificate Authentication In A Web Agent.
SPR # JSHN7A3MLP: Authentication data in the Header element of WS Consumer SOAP envelopes Unfortunately there is nothing further we can do in Support at this time.

Upvotes: 1

Views: 917

Answers (1)

Dmytro Pastovenskyi
Dmytro Pastovenskyi

Reputation: 5419

If I understood your problem correctly you do not know how to deal with SOAP header and if so there are 2 things you may want to know:

1) Passing session using native Domino consumer approach. See example below

TestServiceLocator service = new TestServiceLocator();
TestPort port = service.getTestPort();
// that would tell to save cookie session between calls
((javax.xml.rpc.Stub)port)._setProperty(javax.xml.rpc.Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);

2) If it does not work for you, you may try to use native SOAP approach. I've blogged about that recently: SOAP and passing session

// Create SOAP Connection  
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();  
SOAPConnection soapConnection = soapConnectionFactory.createConnection();  
// connect to webserivce
SOAPMessage soapResponse = soapConnection.call(connect(username, password), url);

// read cookie from response and use it when send another requests
MimeHeaders session = soapResponse.getMimeHeaders(); 
String sesisonCookie = session.getHeader("Set-Cookie")[0];

SOAPMessage soapResponse2 = soapConnection.call(customerGetAll(sesisonCookie), url);
soapConnection.close();

and than imagine you are in customGetAll method

SOAPBody soapBody = envelope.getBody();
SOAPElement soapBodyElem = soapBody.addChildElement("Customer_GetAll", "m");
soapMessage.getMimeHeaders().addHeader("Cookie", sesisonCookie);
soapMessage.saveChanges();

Hope it will help.

Upvotes: 3

Related Questions