Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I implement a java password authentication

Status
Not open for further replies.

mrdee1205

Technical User
Nov 21, 2001
2
US
Hi,

I'm currently working on a project, and I need to implement a java code for password authentication on a website.
I'm not too familiar with jave applets etc.
How do I implement such a feature, and is there a code out there that I can use ?

Thanks
mr dee
 
I've done it the cheesy way, which is to store the usernames and passwords as a properties file on the server and read that file in the applet, then compare the passwords (using the username as an index into the Properties object).
Highly insecure, but for the site in question it was more a gimmick than anything. For a serious project not to be considered at all unless you store encrypted passwords in the file (that way all someone could get from reading the file are the usernames).

Better way is to store the usernames and passwords in a database on the server and have the authentication request handled serverside by a Servlet or EJB.
That would obviate the need for an applet, but will mean you need to have a server where you can run Servlets and (optionally) EJB and you need a database server as well.

Many books on Servlets and EJB contain examples of authentication and authorisation control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top