-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Where to store Swing app database username and password?
PostPosted: Wed Feb 04, 2004 12:51 pm 
Beginner
Beginner

Joined: Thu Nov 20, 2003 1:30 pm
Posts: 27
It is alot simpler to have one database user and do ACL that way.

Simple question...Where and how should I store the username and password for a Swing application?

So users don't find the username and password and login to the database directly, would my best bet be to store an encrypted username and password in a properties file and decrypt it before sending to the database server?

Just wanted to know other's thoughts on this problem, obviously web applications don't have this problem because no one will ever have access to look at a username and password stored on the web server.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2004 1:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well everybody evil can still decrypt your password himself since your application has to contain the key and algorithm to decrypt and thats pretty easy to crack. You shouldn't have applications possibly malicious users use connect to your database directly anyways.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2004 2:31 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
Java 1.4 has build in Kerberos support. I'd start there. Check out the javax.security.auth.kerberos package. Or try other classes in the javax.security.auth subpackages.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2004 2:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
The java security features are quite nice actually, however I have not heard of anyone using it for direct authenitcation against the database (so in a 2-layer architecture). Is that possible?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 04, 2004 2:52 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 1:24 pm
Posts: 213
Location: Richardson, TX
Well, I hear that postgres can be a kerberos service. http://www.guides.sk/pgsql/sgml/auth-methods.html#KERBEROS-AUTH

I'm assuming that the java classes could interface with it. Big "if," though. :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 14, 2004 8:00 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
greg_barton wrote:
Well, I hear that postgres can be a kerberos service. http://www.guides.sk/pgsql/sgml/auth-methods.html#KERBEROS-AUTH

I'm assuming that the java classes could interface with it. Big "if," though. :)

I do not think it can help, you need to protect keys any way, if you do not want to let user connecto to database without app.
The most common way for desktop app is to use RDBMS security, user know his password and enters on app startup (app never stores passwords itself). If input validation rules and security is implemented in RDBMS you do not need to care about connection type (direct access is safe as app connection).

P.S. I am sure java developers can not agree with this, but do not ignore
RDMS features if you need quality.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.