[Logo]
Forums Register Login
Form Based Authentication is not working
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
Hi Krutika Ravi,

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

Regards,
Frits
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
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
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
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
 

<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
<servlet-constraint> ??? It must be <security-constraint> no ?
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
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards


This thread has been viewed 781 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 24, 2018 01:24:47.