web services - Kerberos Authentication header for JAX-WS clin -
web services - Kerberos Authentication header for JAX-WS clin -
i generating webservice using ws-import connect aspx service have secured kerberos on iis. able connect , authenticate fine when connect service using soapconnection
final soapconnection conn = soapconnectionfactory.newinstance().createconnection(); seek { final messagefactory msgfactory = messagefactory.newinstance(); final soapmessage message = msgfactory.createmessage(); final mimeheaders headers = message.getmimeheaders(); if (spnegotoken != null) { headers.addheader("soapaction", "http://tempuri.org/helloworld"); headers.addheader("authorization", "negotiate " + base64.encode(spnegotoken)); } message.getsoapbody().addbodyelement(new qname("http://tempuri.org/", "helloworld", "tem")); final soapmessage response = conn.call( message, "http://server:9994/webservice/sampleservice.asmx"); homecoming response.getsoapbody().gettextcontent(); } { conn.close(); }
however unable add together authorization header jaxws generated ws in same way:
final sampleservicesoap sss= new sampleservice().getsampleservicesoap(); ((bindingprovider) sss).getrequestcontext().put( "authorization", "negotiate " + base64.encode(spnegotoken)); homecoming sss.helloworld();
i 401 error token cannot see token attached in wireshark. can point me @ approach should take? cheers, barry
sorted, turns out pretty close:
final map<string, list<string>> headers = new hashmap<string, list<string>>(); headers.put("authorization", collections.singletonlist("negotiate " + base64.encode(tgt))); ((bindingprovider) sss).getrequestcontext().put(messagecontext.http_request_headers, headers);
web-services jax-ws kerberos wsimport
Comments
Post a Comment