Clone URL (Committers only):
https://cms.apache.org/redirect?new=anonymous;action=diff;uri=http://tomee.apache.org/tomee-jaas.mdtext



Index: trunk/content/tomee-jaas.mdtext
===================================================================
--- trunk/content/tomee-jaas.mdtext     (revision 1490880)
+++ trunk/content/tomee-jaas.mdtext     (working copy)
@@ -21,27 +21,32 @@
 
     <?xml version='1.0' encoding='utf-8'?>
     <Server port="8005" shutdown="SHUTDOWN">
-      <Listener className="org.apache.tomee.loader.OpenEJBListener" />
-      <Listener className="org.apache.catalina.security.SecurityListener" />
-    
+        ...
       <Service name="Catalina">
-        <Connector port="8080" protocol="HTTP/1.1" 
-                   connectionTimeout="20000" 
-                   redirectPort="8443" />
-        <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
+          ...
         <Engine name="Catalina" defaultHost="localhost">
-          <!-- here is the magic -->
-          <Realm className="org.apache.catalina.realm.JAASRealm" 
appName="PropertiesLoginModule"
-              
userClassNames="org.apache.openejb.core.security.AbstractSecurityService$User"
-              
roleClassNames="org.apache.openejb.core.security.AbstractSecurityService$Group">
+            ..
+          <Realm className="org.apache.catalina.realm.JAASRealm" 
appName="PropertiesLogin"
+              
userClassNames="org.apache.openejb.core.security.jaas.UserPrincipal"
+              
roleClassNames="org.apache.openejb.core.security.jaas.GroupPrincipal">
           </Realm>
-    
-          <Host name="localhost"  appBase="webapps"
-                unpackWARs="true" autoDeploy="true" />
         </Engine>
       </Service>
     </Server>
 
+**OR** in your application-specific context.xml
+
+    <?xml version="1.0" encoding="UTF-8"?>
+    <Context>
+        <Realm
+            className="org.apache.catalina.realm.JAASRealm" 
+            
roleClassNames="org.apache.openejb.core.security.jaas.GroupPrincipal"
+            
userClassNames="org.apache.openejb.core.security.jaas.UserPrincipal" 
+            appName="FOO"
+        />
+    </Context>
+
+
 Configure your `login.config` file
 
     PropertiesLogin {
@@ -51,6 +56,14 @@
         GroupsFile="groups.properties";
     };
 
+Create `users.properties`, e.g.
 
-Configure your login module specifically (users.properties for snippets of 
this page for instance)
+    user1=passw1
+    user2=passw2
 
+Create `groups.properties`, e.g.
+
+    Role1=user1,user2
+
+
+Configure your login module specifically (users.properties for snippets of 
this page for instance)
\ No newline at end of file

Reply via email to