geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1037984 - in /geronimo/samples/branches/2.1: ./ repository/ samples/generic-auth/ samples/generic-auth/generic-auth-war/src/main/webapp/ samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/ samples/generic-auth/generic-auth-war/s...
Date Tue, 23 Nov 2010 03:11:40 GMT
Author: xiaming
Date: Tue Nov 23 03:11:40 2010
New Revision: 1037984

URL: http://svn.apache.org/viewvc?rev=1037984&view=rev
Log:
GERONIMO-5710 remove unused repository module and update generic-auth sample

Removed:
    geronimo/samples/branches/2.1/repository/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/forbidden/
Modified:
    geronimo/samples/branches/2.1/pom.xml
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/web.xml
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/index.html
    geronimo/samples/branches/2.1/samples/generic-auth/readme.txt

Modified: geronimo/samples/branches/2.1/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/pom.xml?rev=1037984&r1=1037983&r2=1037984&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/pom.xml (original)
+++ geronimo/samples/branches/2.1/pom.xml Tue Nov 23 03:11:40 2010
@@ -95,8 +95,7 @@
     </pluginRepositories>-->
 
     <modules>
-        <module>buildutil</module>
-        <!--<module>repository</module>-->
+        <module>buildutil</module>        
         <module>geronimo-samples-archetype</module>
         <module>samples</module>
     </modules>

Modified: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/web.xml?rev=1037984&r1=1037983&r2=1037984&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/web.xml
Tue Nov 23 03:11:40 2010
@@ -16,8 +16,8 @@
 
 <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
-         version="2.4">
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
+         version="2.5">
 
     <!-- Welcome File List -->
     <welcome-file-list>
@@ -35,15 +35,7 @@
       <auth-constraint>
         <role-name>content-administrator</role-name>
       </auth-constraint>
-    </security-constraint>
-    
-    <security-constraint>
-      <web-resource-collection>
-        <web-resource-name>No Access</web-resource-name>
-        <url-pattern>/forbidden/*</url-pattern>
-      </web-resource-collection>
-      <auth-constraint/>
-    </security-constraint>
+    </security-constraint>    
 
     <login-config>
       <auth-method>GENERIC</auth-method>

Modified: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/index.html?rev=1037984&r1=1037983&r2=1037984&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/index.html
(original)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/index.html
Tue Nov 23 03:11:40 2010
@@ -18,16 +18,58 @@
 -->
 <html>
     <body>
-        <h3>Testing The Properties File Security Realm</h3>
-        <p>The 2 properties files are located under <I>WASCE_HOME</I>/var/security:
<b>demo_groups.properties</b> & <b>demo_users.properties</b></p>
-        <p>
-        Once this sample has been installed, click on <a href='protect/hello.html'>Protect</a>
to validate against the properties file. You will be shown a login screen, use the following
usernames and passwords to login:
-        <p>username=<b>alan</b>    password=<b>starcraft</b></p>
-        <p>username=<b>metro</b>    password=<b>mouse</b></p>
-        <p>username=<b>george</b>    password=<b>bone</b></p>
-        
-        If everything works, you should see "hello world" in your browser.
+        <h3>Demonstrate GENERIC authentication</h3>
+        <p>This sample defines one security realm with two new login modules: 
+        <ul>
+            <li><b>org.apache.geronimo.security.realm.providers.GenericHttpHeaderPropertiesFileLoginModule</b></li>
+            <li><b>org.apache.geronimo.security.realm.providers.GenericHttpHeaderSqlLoginmodule</b></li>
+        </ul>         
         </p>
-        <p>At this point you have an application that is validating username and passwords
against the properties file based on the security configuration you provided earlier. Now,
if you go back here and click on <a href='forbidden/'>Forbidden</a> you should
receive a 403 - Forbidden HTTP error.</p>
+        
+        <p>There is another new login module for LDAP authentication: <b>org.apache.geronimo.security.realm.providers.GenericHttpHeaderLdapLoginModule</b>.
It requires some additional LDAP configuration, and not be able to demonstrate in this sample.
But you can refer to comment-out section of the sample's geronimo deployment plan for details.</p>
+        
+        <p>Follow these steps to run this sample:
+        <ol>
+        	<li>Configure Apache HTTP web server to proxy HTTP request for Geronimo server.<br>
+        	<br>
+        	Add these lines to APACHE_HOME/conf/httpd.conf:<br>
+        	<code>
+        	LoadModule proxy_module modules/mod_proxy.so<br>
+			LoadModule proxy_http_module modules/mod_proxy_http.so<br>
+			&lt;IfModule mod_proxy.c&gt;<br>
+			ProxyPass /generic-auth http://localhost:8080/generic-auth<br>
+			ProxyPassReverse / http://localhost:8080/<br>
+			&lt;/IfModule&gt;<br>
+			</code>
+        	</li><br>
+        	<li>Mimic SiteMinder behavior via mod_headers module.<br>
+        	<br>
+        	Add these lines to APACHE_HOME/conf/httpd.conf:
+			<code>
+			LoadModule headers_module modules/mod_headers.so<br>
+			&lt;IfModule mod_headers.c&gt;<br>
+			&lt;Location /generic-auth&gt;<br>
+			RequestHeader  add  SM_USER	<b>USERNAME</b><br>
+			&lt;/Location&gt;<br>
+			&lt;/IfModule&gt;<br>
+			</code><br>
+			The <b>USERNAME</b> could be replaced with these users one by one: <b>izumi,
tom, alan, nobody</b><br><br>			
+			<b>izumi</b> is a valid user defined in file property "var/security/demo_groups.properties"
with manager role.<br>			
+			<b>tom</b> is a valid user defined in SQL login module with manager role.<br>
+			<b>alan</b> is a valid user defined in SQL login module without manager role.<br>
+			<b>nobody</b> is not a valid user in any security login module.<br>
+        	</li><br>
+        	<li>
+        		Change the username field as above, restart Apache HTTP server, then visit <a
href='http://localhost/generic-auth/protect/hello.html'>this link</a>.        		
       		
+        	</li>
+        </ol>        
+        <ul>
+        		You should see these expected results:        
+				<li>izumi -- should see the hello world page with HTTP 200 status
+				<li>tom -- should see the hello world page with HTTP 200 status
+				<li>alan -- should not see the hello world page with HTTP 403 status
+				<li>nobody -- should not see the hello world page with HTTP 401 status
+				</ul>
+        </p>        
     </body>
 </html>

Modified: geronimo/samples/branches/2.1/samples/generic-auth/readme.txt
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/readme.txt?rev=1037984&r1=1037983&r2=1037984&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/readme.txt (original)
+++ geronimo/samples/branches/2.1/samples/generic-auth/readme.txt Tue Nov 23 03:11:40 2010
@@ -64,7 +64,7 @@ RequestHeader  add  SM_USER	<username>
 The <username> could be replaced with these users respectively: izumi, tom, alan, nobody
 
 
-3. Change the username field as above, restart Apache HTTP server, then visit this linke
+3. Change the username field as above, restart Apache HTTP server, then visit this link
         http://localhost/generic-auth/protect/hello.html
 
 You should see these expected results:        



Mime
View raw message