• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Suggestion : Understanding behavior of Form Authentication

 
Hitesh Kumar C
Ranch Hand
Posts: 35
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

While preparing for OCEJWCD, i was working with the Form Authentication.

I'm able to implement it with Tomcat 7.0 Web Server, but i have one doubt in the behavior of how Form Authentication actually works.

Here is the behavior which it got understood that is working fine.



Behavior which i didn't understood is:

(Why?)

Once, I'm authenticated and if i'm trying it again with same user name and password configure in tomcat-users.xml, I'd end up with this error:

HTTP Status 404 - /Authorization/j_security_check

type Status report

message /Authorization/j_security_check

description The requested resource (/Authorization/j_security_check) is not available.
Apache Tomcat/7.0.10


JSP File:


web.xml



tomcat-users.xml


My question is that if I'm already authenticated and I'm on login.jsp and I'm trying login again then why I am getting the Http 404 Error? and the same configurations worked for me while login initially?

Please give your suggestions on this and update me if I've done something wrong.

Thanks in advance.
 
Hitesh Kumar C
Ranch Hand
Posts: 35
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anybody?
 
Joan Breton
Greenhorn
Posts: 15
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because you can't point to the login.jsp again , the correct use is :

login.jsp > FormAuthentication > If(Success) > goto(login.jsp OTHER_PROTECTED_RESOURCE)
login.jsp > FormAuthentication > If(Failure) > goto(Error.html)



See this post: http://www.coderanch.com/t/82393/Tomcat/Invalid-direct-reference-form-login

Good look.
 
Hitesh Kumar C
Ranch Hand
Posts: 35
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the such a nice observation.
Got the concept.

Thank you so much.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic