jQuery in Action, 3rd edition
The moose likes Java in General and the fly likes best way to store user info Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "best way to store user info" Watch "best way to store user info" New topic

best way to store user info

Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

I have a java standalone application in witch user is required to login .
my application needs to store user username & password , so if user run application later he is automatically authenticated with his previous stored username & password.

I stored user infos using java serialization : used a class User which i serialize to a file & save it to user hard disk. this class is each time deserialized to try authenticating user automatically.
I don't believe this serialization solution is elegant . because the serialized file could be changed or deleted by user. it is also difficult to make it a hidden file because i want my app to be cross-platform and hiding files is different across different platforms.
so i'm looking for a better & elegant way to store user login infos .
using database is not appropriate in my case.and i want these private data to be hidden andnot accessible to malicious users.
Any good ideas how to do that ?
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

There are countless existing security frameworks out there. Start with the links in the Java Ranch Security FAQ. You might want to look at something like JAAS as a solution.

There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
I agree. Here's the link: http://aspose.com/file-tools
subject: best way to store user info
It's not a secret anymore!