File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

call j_security_check from within a servlet

 
Jean-Claude Rouvinez
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We are using the container managed authentication of TOMCAT
(Apache Tomcat 5.5.9, please see http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#JAASRealm).

In some cases we want to perform an "automatic login" and so replace the login page by a servlet. This servlet should call j_security_check with the right parameters (j_username, j_password).

Is that possible?
If yes, could anybody post an example of the code?

Thank you for your help
[ November 02, 2006: Message edited by: Jean-Claude Rouvinez ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never see this done in a platform neutral way, but typically you do not access the j_security_check, you just call a 'login module' on the server side and pass the credentials. I'm not sure how to do it in Tomcat, but in Websphere you use the SSOAuthenticator
 
Jean-Claude Rouvinez
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Reply to David O'Meara)
You are right. We did it in that way.

The problem is when a user has just registered. In that case we don't want him to go to the login screen and type his password again. After the registration the user is directly forwarded to the protected area. Therefore our idea was to simulate the login screen with a servlet.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic