aspose file tools*
The moose likes Security and the fly likes windows authentication with JSF - SQL Server taking system name instead of username Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "windows authentication with JSF - SQL Server taking system name instead of username" Watch "windows authentication with JSF - SQL Server taking system name instead of username" New topic
Author

windows authentication with JSF - SQL Server taking system name instead of username

sam mat
Greenhorn

Joined: Feb 01, 2012
Posts: 4
I am trying to connect to SQL server using Windows Authentication from a jsf Web application.But when i try logging in with the windows credentials the DriverManager.getconnection seems to be taking the machine name instead of the username.

My connection string: jdbc:sqlserver://<host>:1433;integratedSecurity=true;
I have added the sqljdbc_auth.dll in the system path and well as in the system32 folder.

I have added the s
set up: jsf1.2, RAD 8.0, IBM WAS 7.0

Thanks for any help you can offer.

regards
Shruthi
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2503
    
    8

Hi,

doesn't it take the system user that is running your web service?


OCUP UML fundamental and ITIL foundation
youtube channel
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2503
    
    8

I have moved your post to our security forum. That is the place where the most knowledge on authentication is available.
Your post is still visible from the JDBC forum, so it can attract attention from there too. Good luck.
sam mat
Greenhorn

Joined: Feb 01, 2012
Posts: 4
Hi Jan,

Yes it takes the system name on which the service is running. How can i allow the Web application to pick up the Windows User credential to login to the Sql server database?
Stuck with this issue from long. Please suggest solutions.


regards
Sam
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2503
    
    8

Hi Sam,

I edited the subject of your post to make it more clear what your problem is. Let's hope it gets the attention of someone who knows.
Regards, Jan
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

There were 2 ways to read this.

1. Attempting to use the web app user's credentials to get the connection. Forget about this one. You certainly won't get any usable Windows credentials from my Linux shop, so any such attempt would only function within your own LAN. Even were it not so, you'd have to give up the considerable benefits of database connection pooling if you went this way, because each app user would be operating under different connection rules and therefore probably differing security constraints, making the sharing of such connections infeasible.

2. Attempting to use the webapp server's user credentials to get the connection. This would eliminate most of the problems with case #1. However, the applicable userid would be the userID of the WebSphere process itself, not of any web user. There's not really a whole lot of benefit to using the Windows login to manage the connection here, however. Any unauthorized user who has sufficient access to be able to read out an explicit password from the appserver configuration already owns the appserver and your problems extend far beyond one database connection.

In short, I wouldn't bother. Use a traditional userid/password connection instead. It's what I did.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: windows authentication with JSF - SQL Server taking system name instead of username