incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramya KGrama" <>
Subject JAAS with JSPWiki
Date Tue, 24 Jun 2008 18:06:04 GMT
I have been trying to implement JAAS login with JSPWiki on Tomcat. We are
using JSPWiki 2.6.2 with Tomcat5.5
We have an existing web application (mainApp) that does not use JAAS.
However, we would like to use JSPWiki as a portal with a single-sign-on
feature -
meaning when the user logs into our mainApp the user clicks on a link to
JSPWiki application. At this point, we would like to automatically
the user with appropriate roles and permissions and log him into JSPWiki.

To acheive this, I have done the following but doesn't seem to work:

1. Tomcat server.xml:
 a. I've added a <Context> tag for JSPWiki application and <Context> tag for
mainApp with crossContext=true in both.
 b. Added a <Realm> entry as such:

 c. Enabled SingleSignOn by adding the <Valve> tag within the <Host> tag as
         <Valve className="org.apache.catalina.authenticator.SingleSignOn"

2. Placed my login module (JAASLoginModule's) jar file JAASLoginLM.jar in
%TOMCAT_HOME%/common/lib folder.
   In the JAASLoginModule itself I am using HttpRequestCallback just like
the SiteMinderLoginModule example:

3. I added the entries for the login module in jspwiki.policy towards the
end as such:

// grant LoginModule permissions
grant codebase "file:${catalina.home}/common/lib/JaasLoginLM.jar" {
    permission "modifyPrincipals";
grant codebase "file:${catalina.home}/common/lib/JaasLoginAzn.jar" {

   permission "doAsPrivileged";

4. In file I enabled JAAS as such: = jaas

5. On tomcat startup I specify the policy file and jaas file settings as
such:\Program Files\Apache Software
Foundation\Tomcat 5.5\webapps\JSPWiki\WEB-INF\jspwiki.jaas\Program Files\Apache Software Foundation\Tomcat

6. Disabled container managed authentication in
<TOMCAT_HOME>/webapps/web.xml by commenting the <security-constraint>
section and
in set jspwiki.userdatabase.isSharedWithContainer = false

 Now, I restart the server and launch the mainApp and login. After logging
in, I click on the link to JSPWiki (http://<hostname:port>/JSPWiki/Wiki.jsp)
which takes me to the main page as an "Anonymous" user.

I dont see JAAS being used. The logs do not show any debug messages from my
JAASLoginModule. Instead it says -
"Checking JAAS configuration...JAAS already configured by some other
application (leaving it alone...)"

My security configuration verifier (SecurityConfig.jsp) says that it found
jspwiki.jaas. It doesn't show any errors - except that it says
"We found some errors with your configuration: Policy file does not have a
keystore... at least not one that we can locate."
Do I need jspwiki.jks file and an entry in policy file - keystore
jspwiki.jks? - Currently I DO NOT have the keystore file.

Do I need to programmatically create the LoginContext and call the login()
method in the JSP?
My understanding was that all that would happen automatically in the
I am sure I'm missing something.

Your help is greatly appreciated!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message