Forums Register Login

User Authentication

+Pie Number of slices to send: Send
Hello everbody,
what are the best possible ways for user authentication in java??Say, I've a user interface done in swing.Before the user try to do some operation, I would like to check for his credentials(password is encrypted).Never done with java before, had experience with PHP using flat files as well as databases.I dont want to use any database here.
pls point me to a nice tutorial,useful links or if somebody had a sample code, I would like to go through too.
Thanks for all your time
+Pie Number of slices to send: Send
 

Originally posted by kimi lynn:
Hello everbody,
what are the best possible ways for user authentication in java??


The user authentication/authorization services Java makes available are in the Enterprise Edition, probably an order of magnitude more complex than you want to get into.


I dont want to use any database here.


Every time I've rolled my own auth I've used a database. It should be pretty easy to use a flat file. Store a user name, hashed password and some flags on a line as a record. Scan through the file using the user name as the record 'index'. If you want to get really fancy (or if performance is an issue, you have a couple hundred users), you could store the user records in order by user name and use java.io.RandomAcccessFile to do a binary search of the records. That would give you database-like speed without the database-like overhead. Of course you'd have to write a maintaince application to add/update/insert/delete records.
+Pie Number of slices to send: Send
Thanks for the information.Any suggested links??
---
+Pie Number of slices to send: Send
You could start with The Java Tutorial I/O Classes. As for links to building your own auth functionality, doesn't look like it on google. Hence the problem with rolling your own: nobody's done it before.
First, you drop a couch from the plane, THEN you surf it. Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 582 times.
Similar Threads
Using other Authentication Providers
java.io.IOException: Server returned HTTP response code: 401 for URL:
captcha in login form
How secure is http post request for sending user authentication data.
JAAS vs Form Based Authentication vs LDAP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:52:08.