Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Question Regarding Authentication

 
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I got a question while giving javaranch mock exam.


Question Bank ID : 16 Choose the 1 correct answer
Which of the following is correct html for 'Form Based Authentication"?



<form method="post" action="security_check">
<input type="text" name="username">
<input type="password" name="password">
</form>


<form method="post" action="j_security_check">
<input type="text" name="j_username">
<input type="password" name="j_password">
</form>


<form method="post" action="your login page">
<input type="text" name="j_username">
<input type="password" name="j_password">
</form>


<form method="post" action="your login page">
<input type="text" name="username">
<input type="password" name="password">
</form>



It has been asked to choose 1 correct answer. Hence I chose the 4th option.
But i want to know that why 3rd option is wrong.

I feel it should be right, since the name of input type can be anything, even j_username and j_password when we are using FORM based authentication.

Kindly clarify!

Thanks
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Option 2 is correct. The form action must be j_security_check for the form based auth.

Thanks
 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right...
My mistake..
Thanks
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic