• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

htpasswd file

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic