• 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

Form Based Authentication is not working

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have been working on Security Chapter and I have implemented the following code. Unable to identify the point of error. Kindly help.

Deployment Descriptor:


tomcat-users.xml


login.jsp
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Krutika Ravi,

try removing the <user-data-constraint> and see what happens

Regards,
Frits
 
Krutika Ravi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Fritz,

That doesn't help.

Correction:
In the above web.xml. Remove
<http-method><http-method>

Don't know where I am losing track.

Kind Regards
Krutika
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Krutika,

In the above web.xml. Remove <http-method><http-method>

Ok, but you can do that still on your posting, just hit the edit button on right top of your posting. That makes this thread also easier to read.

What is exactly the problem? Do you get to the login page? Or can't you go beyond it? Do you get an error?

I guess that your are using j_username, j_password, and j_security_check ? ( with underscores, they might not show well on this page )

Regards,
Frits
 
Krutika Ravi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Frits,

I do get the Edit Option on the Comments I am posting now. But for the first Post I get to see only the Quote Button.

Problems which I face:
a) I try opening a page and ideally I should be directed to the Form but that ain't happening.
b) I tried using BASIC Authentication and I don't get a prompt either.
c) I downloaded a brand new Tomcat container and my code still fails to give me a prompt.

Thanks
Kind Regards
Krutika
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try removing the security from your web-application and see if you can get to the login.jsp without any problems.

If not, then the URL you are using is not good or the structure of your .war file is not good.

Regards,
Frits
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<form-login-page>/login</form-login-page>


I believe, in <form-login-page>, you can't use a url pattern. Instead you should use the actual relative url /login.jsp
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<servlet-constraint> ??? It must be <security-constraint> no ?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

@Angy:

<servlet-constraint> ??? It must be <security-constraint> no ?


Yes, that is definitely a mistake.

@Jalil Idrissi:

I believe, in <form-login-page>, you can't use a url pattern. Instead you should use the actual relative url /login.jsp


No, that is not needed.

Just have a look at the following web.xml and try it yourself (it works well)

Regards,
Frits
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic