• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Suggestion : Understanding behavior of Form Authentication

 
Ranch Hand
Posts: 35
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anybody?
 
Greenhorn
Posts: 16
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: https://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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the such a nice observation.
Got the concept.

Thank you so much.
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic