Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Authentication
Authentication [message #586807] Wed, 25 July 2007 15:15
Eclipse UserFriend
Originally posted by: ebizot.yahoo.fr

Hi,

I have to make a BIRT report based on a "Web Services Data Source".
My web service is basic secured but the
org.eclipse.datatools.enablement.oda.ws connection does'nt support basic
authentication and so it does'nt work for me.

Rather than developping my own Connection or plugin I've tried to change
the plugin sources like this :
I have changed the
org.eclipse.datatools.enablement.oda.ws.RawMessageSender class adding :
=> a specific Authenticator :
static class SoapAuthenticator extends Authenticator {
private String username, password;
public SoapAuthenticator(String user, String pass) {
username = user;
password = pass;
}
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username,

password.toCharArray());
}
}

=> authentication in RawMessageSender::SOAPResponseCollector :
public void run() {
try {
URL url = new URL(spec);
if(url.getUserInfo() != null) {
String [] loginInfo = url.getUserInfo().split(":");
String user = (loginInfo.length > 0)? loginInfo[0] :
WSUtil.EMPTY_STRING;
String pwd = (loginInfo.length > 1)? loginInfo[1] :
WSUtil.EMPTY_STRING;
HttpURLConnection.setDefaultAllowUserInteraction(true);
Authenticator.setDefault(new SoapAuthenticator(user,
pwd));
}
connection = (HttpURLConnection) url.openConnection();
...

and I'm connecting my web service with thoose parameters :
WSDL URL : http://server:port/.../myService?wsdl
SOAP End Point : http://user:password@server:port/.../myService

I'm not sure it's the best solution but it's working.

Is it possible to integrate authentication in next versions ?

Thanks a lot,

Emmanuel BIZOT
Previous Topic:Authentication
Next Topic:Connection Framework for RCP - Best practises?
Goto Forum:
  


Current Time: Fri Apr 19 14:08:12 GMT 2024

Powered by FUDForum. Page generated in 0.01198 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top