JAAS Authentication using Servlet Filter. 2004-05-18 - By Ben Hill
Back I'm trying to implement a servlet filter that intercepts requests to a servlet and if the user is not authenticated, run the supplied username and password through a JAAS authentication cycle. I'm using the Tomcat 4.x server.
I would like to know how this process is done using the j_security_check as I'd like to implement the same functionality. I wish to be able to JAAS authenticate when the filter intercepts the request so that after the authentication I can call request.isUserInRole(), request.getUserPrincipal(), request.getRemoteUser() etc.
After looking at the API docs at http://jakarta.apache.org/tomcat/tomcat-4 (See http://cat-4.ora-code.com).1-doc/catalina/docs/api/index.html I have found the org.apache.catalina.realm.JAASCallbackHandler and suspected that if I can find the realm, (set up as a JDBC realm in the server.xml), and then pass in the username and password to this callback handler - I can run the .login() method somehow.
Any help would be appreciated, if you know of any howtos or docs, that would be great!
Cheers,
Ben
********************************************************************
This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you
Check us out at http://www.btsyntegra.com
********************************************************************
==========================================================================To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|