Subject Re: [IB-Java] Direct Client and authentication
Author David Jencks
Thanks

I moved the code around a bit but have applied this.

Also, now you can set default UserName and Password properties on the
ManagedConnectionFactory and they should be used if no Subject or
username/password in ConnectionRequestInfo is supplied.



david jencks

On 2001.12.05 05:58:01 -0500 "Goedhart, Andrew" wrote:
> 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
>
>
> To unsubscribe from this group, send an email to:
> IB-Java-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>