aspose file tools*
The moose likes JSP and the fly likes htpasswd file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "htpasswd file" Watch "htpasswd file" New topic
Author

htpasswd file

Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
Hi all,

I have this JSP form, where onload i'm capturing the staff number of the user and on submit i want the user to enter their password

This password is stored in the htpasswd file on the server.

The passwords are encrypted using MD5 algorithm which is modified for apache.

How can i authenticate the users upon submit??

I have found out the below:
1. when i give the command : /htpasswd username password
gives me a different encryption each time. So, i cannot use the standard MD5 encrytion to encrypt and compare.


On this website :http://httpd.apache.org/docs-2.0/programs/htpasswd.html
i found out that the htpasswd have different exit status. I'm quoting the below from this website itself...

htpasswd returns a zero status ("true") if the username and password have been successfully added or updated in the passwdfile. htpasswd returns 1 if it encounters some problem accessing files, 2 if there was a syntax problem with the command line, 3 if the password was entered interactively and the verification entry didn't match , 4 if its operation was interrupted, 5 if a value is too long (username, filename, password, or final computed record), 6 if the username contains illegal characters (see the Restrictions section), and 7 if the file is not a valid password file.


The exit status 3 is the one that i'm looking for, but i don't know what command line shall i give to compare passwords for users.
Can any one help me out on this one.

If i have posted the question in wrong forum, please transfer this question to the right forum.

Thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: htpasswd file
 
Similar Threads
restricting access to pages
suggest me a better way to store passwords!!
Java Beans and JSP
if i store a password data from jsp to the database how to hide it from others seeing
MD5