It's not a secret anymore!
The moose likes Servlets and the fly likes Authentication login screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Authentication login screen" Watch "Authentication login screen" New topic

Authentication login screen

Shuaib Gill
Ranch Hand

Joined: May 29, 2001
Posts: 62
Hello folks,
I am trying to set up a login screen using Java authentication concepts. Basically, I began with the following .htm form:
<title>A login page</title>
<h2>You have requested a secure page, please login</h2>
<form method="POST" action="j_security_check">
<tr><td>User</td><td><input type=text name="j_username"></tr>
<tr><td>Password</td><td><input type=password name="j_password"></tr>
<input type=submit>
I used j_security_check,j_username,j_password because for authentication, the web server is supposed to recognize these variables. I am using FORM validation by the way. Ok, I also edited the deployment descriptor (web.xml for JRUN which is what I'm using. Here it is:
<display-name>JRun Demo</display-name>
<description>JRun Demo</description>

<web-resource-name>just a test</web-resource-name>
<description>Test application</description>
<description>For users</description>

I then added users to the file, like this:
# This file contains a list of user names and their corresponding
# encrypted password. The format is:
# user.{username}={encrypted password}
# Each user can also be part of a group. Groups are defined in # the
# following way:
# group.{group name}={list of users}
# The list consists of user names separated by a comma. To # specify
# all users use a wildcard character (*)
# Users and groups can also be part of a role. Roles are defined
# in the following way:
# role.{role name}={list of users and/or groups}
# Users are specified by prepending "user." to the user name, # while
# groups are specified by prepending "group." to the group name. # If
# no prefix is given the name will be searched for as a user # first
# then as a group. To specify all users use a wildcard character # (*).
When it was all said and done, when I logged in with sg77 as username and nnn23j as password, it did not work. I don't understand why. I also tried to add users from the MS-DOS command prompt only to get "Access is denied" error. I do not understand why, I went step by step in the JRUN docs.
Hope someone can help.

Julia Reynolds
Ranch Hand

Joined: May 31, 2001
Posts: 123
You didn't encrypt the password in your property file.
Could that be the problem? You might want to check
the allaire developer site for help with getting JRUN working.
JRUN can be obstinate.
I agree. Here's the link:
subject: Authentication login screen
It's not a secret anymore!