Subject RE: [IB-Java] Direct Client and authentication
Author Goedhart, Andrew
Heres what seems to be the fix for using the using proper authentication
with connectors and Jboss. This combined with Alejandro's fix which he has
already submitted to CVS makes the dirver usable with Jboss on windows.

the following changes have to be made to
FBManagedConnectionFactory.createManagedConnection()

public ManagedConnection createManagedConnection(Subject subject,
ConnectionRequestInfo
cxRequestInfo)
throws ResourceException {
if (cxRequestInfo == null) {
cxRequestInfo = defaultCri;
}
if (cxRequestInfo instanceof FBConnectionRequestInfo) {
Iterator iter = subject.getPrivateCredentials().iterator();
if (iter.hasNext()) {
PasswordCredential cred = (PasswordCredential) iter.next();
String user = cred.getUserName();
String password = new String(cred.getPassword());
((FBConnectionRequestInfo) cxRequestInfo).setPassword(password);
((FBConnectionRequestInfo) cxRequestInfo).setUser(user);
}
}
return new FBManagedConnection(subject, (FBConnectionRequestInfo)
cxRequestInfo, this);
}

This forces the connection to use the supplied credentials when logging onto
the database


Could someone please put this into CVS as I don't have access

Andrew