• 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

Question Regarding Authentication

 
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right...
My mistake..
Thanks
 
Die Fledermaus does not fear such a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic