geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1037643 - in /geronimo/samples/branches/2.1/samples/generic-auth: ./ generic-auth-tomcat/ generic-auth-tomcat/src/ generic-auth-tomcat/src/main/ generic-auth-tomcat/src/main/plan/ generic-auth-war/ generic-auth-war/src/ generic-auth-war/sr...
Date Mon, 22 Nov 2010 09:29:22 GMT
Author: xiaming
Date: Mon Nov 22 09:29:21 2010
New Revision: 1037643

URL: http://svn.apache.org/viewvc?rev=1037643&view=rev
Log:
GERONIMO-5710 Add a new sample about new login module - Generic HTTP header-based authentication

Added:
    geronimo/samples/branches/2.1/samples/generic-auth/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/pom.xml   (with
props)
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/src/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/src/main/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/src/main/plan/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/src/main/plan/plan.xml
  (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/pom.xml   (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/java/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/resources/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/resources/SQLRealmData.sql
  (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/geronimo-web.xml
  (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/web.xml
  (with props)
    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/auth/logon.html
  (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logonError.html
  (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/forbidden/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/forbidden/hello.html
  (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/index.html
  (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/protect/
    geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/protect/hello.html
  (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/pom.xml   (with props)
    geronimo/samples/branches/2.1/samples/generic-auth/readme.txt   (with props)

Added: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/pom.xml?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/pom.xml (added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/pom.xml Mon Nov
22 09:29:21 2010
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!-- $Rev: 639460 $ $Date: 2008-03-20 17:12:27 -0400 (Thu, 20 Mar 2008) $ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.samples</groupId>
+        <artifactId>generic-auth</artifactId>
+        <version>2.1.3-SNAPSHOT</version>
+    </parent>
+    
+    <artifactId>generic-auth-tomcat</artifactId>
+    <name>Geronimo Samples :: generic-auth :: plugin for tomcat</name>
+    <packaging>car</packaging>
+
+    <description>Geronimo Samples. generic-auth Plugin for tomcat</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.samples</groupId>
+            <artifactId>generic-auth-war</artifactId>
+            <version>${version}</version>
+            <type>war</type>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.samples</groupId>
+            <artifactId>sample-datasource</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>tomcat6-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>jasper-deployer</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>        
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>tomcat6</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>jasper</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+        </dependency>        
+        
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>${pom.basedir}/src/main/plan</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.buildsupport</groupId>
+                <artifactId>car-maven-plugin</artifactId>
+                <configuration>
+                    <deploymentConfigs>
+                        <deploymentConfig>${gbeanDeployer}</deploymentConfig>
+                        <deploymentConfig>${j2eeDeployer}</deploymentConfig>
+                        <deploymentConfig>${tomcatDeployer}</deploymentConfig>
+                        <deploymentConfig>${jasperDeployer}</deploymentConfig>
+                    </deploymentConfigs>
+                    <module>
+                        <groupId>org.apache.geronimo.samples</groupId>
+                        <artifactId>generic-auth-war</artifactId>
+                        <version>${version}</version>
+                        <type>war</type>
+                    </module>
+                    <useMavenDependencies>
+                        <value>true</value>
+                        <includeVersion>true</includeVersion>
+                    </useMavenDependencies>
+                    <category>Sample</category>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/src/main/plan/plan.xml?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/src/main/plan/plan.xml
(added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/src/main/plan/plan.xml
Mon Nov 22 09:29:21 2010
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1" 
+         xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2" 
+         xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" 
+         xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> 
+
+  <context-root>/generic-auth</context-root>
+
+  <security-realm-name>GenericRealm</security-realm-name>
+  <sec:security>
+    <sec:role-mappings>
+      <sec:role role-name="content-administrator">
+		<sec:principal name="manager" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
/>
+      </sec:role>
+    </sec:role-mappings>
+  </sec:security>
+  
+  <gbean name="GenericSQLRealmData" class="org.apache.geronimo.connector.DatabaseInitializationGBean">
 
+       <attribute name="path">SQLRealmData.sql</attribute>
+       <reference name="DataSource">
+           <name>SampleNoTxDatasource</name>
+       </reference>
+  </gbean>
+  
+  <gbean name="GenericRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm"
xsi:type="dep:gbeanType" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        <attribute name="realmName">GenericRealm</attribute>
+        <reference name="ServerInfo">
+            <name>ServerInfo</name>
+        </reference>
+        <xml-reference name="LoginModuleConfiguration">
+            <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
+                <!-- Generic HTTP header-based login module for file properties realm
-->
+                <log:login-module control-flag="SUFFICIENT" wrap-principals="false">
+                    <log:login-domain-name>GenericFilePropRealm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.GenericHttpHeaderPropertiesFileLoginModule</log:login-module-class>
+                    <log:option name="groupsURI">var/security/demo_groups.properties</log:option>
+					<log:option name="headerNames">SM_USER</log:option>
+					<log:option name="authenticationAuthority">Siteminder</log:option>
+                </log:login-module>
+                <!-- Generic HTTP header-based login module for SQL realm -->
+                <log:login-module control-flag="SUFFICIENT" wrap-principals="false">
+                    <log:login-domain-name>GenericSQLRealm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.GenericHttpHeaderSqlLoginmodule</log:login-module-class>
+                    <log:option name="groupSelect">SELECT username, groupname FROM
genericgroups WHERE username=?</log:option>
+                    <log:option name="dataSourceApplication">null</log:option>
+                    <log:option name="dataSourceName">SampleNoTxDatasource</log:option>
+					<log:option name="headerNames">SM_USER</log:option>
+					<log:option name="authenticationAuthority">Siteminder</log:option>
+                </log:login-module>
+                <!-- Generic HTTP header-based login module for LDAP realm -->
+                <!--<log:login-module control-flag="SUFFICIENT" wrap-principals="false">
+                    <log:login-domain-name>dw-ldap-realm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.GenericHttpHeaderLdapLoginModule</log:login-module-class>
+                    <log:option name="initialContextFactory">com.sun.jndi.ldap.LdapCtxFactory</log:option>
+                    <log:option name="userBase">ou=users,ou=system</log:option>
+                    <log:option name="roleSearchMatching">(uniqueMember={0})</log:option>
+                    <log:option name="userSearchSubtree">false</log:option>
+                    <log:option name="connectionPassword">secret</log:option>
+                    <log:option name="authentication">simple</log:option>
+                    <log:option name="roleBase">ou=groups,ou=system</log:option>
+                    <log:option name="connectionUsername">uid=admin,ou=system</log:option>
+                    <log:option name="connectionURL">ldap://hostname_or_ip:port</log:option>
+                    <log:option name="roleName">cn</log:option>
+                    <log:option name="userSearchMatching">uid={0}</log:option>
+                    <log:option name="roleSearchSubtree">false</log:option>
+					<log:option name="headerNames">SM_USER</log:option>
+					<log:option name="authenticationAuthority">Siteminder</log:option>					
+                </log:login-module>-->
+            </log:login-config>            
+        </xml-reference>
+    </gbean>	
+</web-app>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-tomcat/src/main/plan/plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/pom.xml?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/pom.xml (added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/pom.xml Mon Nov 22
09:29:21 2010
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.samples</groupId>
+        <artifactId>generic-auth</artifactId>
+        <version>2.1.3-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>generic-auth-war</artifactId>
+    <name>Geronimo Samples :: generic-auth war</name>
+    <packaging>war</packaging>
+
+    <description>
+		A Sample to demonstrate GENERIC Authentication method, which is http header-based authentication.
+    </description>    
+    
+    <build>
+		<plugins>
+			<plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <archiveClasses>false</archiveClasses>
+                    <webResources>
+                        <resource>
+							<directory>${project.build.outputDirectory}</directory>
+							<includes>
+								<include>META-INF/LICENSE*</include>
+								<include>META-INF/NOTICE*</include>
+								<include>META-INF/DISCLAIMER*</include>
+							</includes>
+						</resource>						
+						<resource>
+							<directory>${pom.basedir}/src/main/webapp/WEB-INF</directory>
+							<targetPath>WEB-INF</targetPath>
+							<filtering>true</filtering>
+							<includes>
+								<include>*.xml</include>								
+							</includes>
+						</resource>
+					</webResources>
+                </configuration>
+            </plugin>
+		</plugins>
+	</build>
+	  	
+</project>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/resources/SQLRealmData.sql
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/resources/SQLRealmData.sql?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/resources/SQLRealmData.sql
(added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/resources/SQLRealmData.sql
Mon Nov 22 09:29:21 2010
@@ -0,0 +1,20 @@
+--  Licensed to the Apache Software Foundation (ASF) under one
+--    or more contributor license agreements.  See the NOTICE file
+--    distributed with this work for additional information
+--    regarding copyright ownership.  The ASF licenses this file
+--    to you under the Apache License, Version 2.0 (the
+--    "License"); you may not use this file except in compliance
+--    with the License.  You may obtain a copy of the License at
+--    
+--     http://www.apache.org/licenses/LICENSE-2.0
+--    
+--    Unless required by applicable law or agreed to in writing,
+--    software distributed under the License is distributed on an
+--    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+--    KIND, either express or implied.  See the License for the
+--    specific language governing permissions and limitations
+--    under the License.
+
+create table genericgroups(username varchar(10),groupname varchar(10));
+insert into genericgroups values('tom','manager');
+insert into genericgroups values('alan','it');

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/resources/SQLRealmData.sql
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/geronimo-web.xml?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/geronimo-web.xml
(added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/geronimo-web.xml
Mon Nov 22 09:29:21 2010
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1" 
+         xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2" 
+         xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0" 
+         xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
+         
+  <sys:environment>
+    <sys:moduleId>
+      <sys:groupId>${project.groupId}</sys:groupId>
+      <sys:artifactId>${project.artifactId}</sys:artifactId>
+      <sys:version>${project.version}</sys:version>
+      <sys:type>car</sys:type>
+    </sys:moduleId>
+    <sys:dependencies>
+		<sys:dependency>
+		    <sys:groupId>org.apache.geronimo.samples</sys:groupId>
+			<sys:artifactId>sample-datasource</sys:artifactId>            
+		</sys:dependency>
+	</sys:dependencies>
+    <sys:hidden-classes/>
+    <sys:non-overridable-classes/>
+  </sys:environment>
+
+  <context-root>/generic-auth</context-root>
+
+  <security-realm-name>GenericRealm</security-realm-name>
+  <sec:security>
+    <sec:role-mappings>
+      <sec:role role-name="content-administrator">
+		<sec:principal name="manager" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
/>
+      </sec:role>
+    </sec:role-mappings>
+  </sec:security>
+  
+  <gbean name="GenericSQLRealmData" class="org.apache.geronimo.connector.DatabaseInitializationGBean">
 
+       <attribute name="path">SQLRealmData.sql</attribute>
+       <reference name="DataSource">
+           <name>SampleNoTxDatasource</name>
+       </reference>
+  </gbean>
+  
+  <gbean name="GenericRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm"
xsi:type="dep:gbeanType" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        <attribute name="realmName">GenericRealm</attribute>
+        <reference name="ServerInfo">
+            <name>ServerInfo</name>
+        </reference>
+        <xml-reference name="LoginModuleConfiguration">
+            <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-2.0">
+                <!-- Generic HTTP header-based login module for file properties realm
-->
+                <log:login-module control-flag="SUFFICIENT" wrap-principals="false">
+                    <log:login-domain-name>GenericFilePropRealm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.GenericHttpHeaderPropertiesFileLoginModule</log:login-module-class>
+                    <log:option name="groupsURI">var/security/demo_groups.properties</log:option>
+					<log:option name="headerNames">SM_USER</log:option>
+					<log:option name="authenticationAuthority">Siteminder</log:option>
+                </log:login-module>
+                <!-- Generic HTTP header-based login module for SQL realm -->
+                <log:login-module control-flag="SUFFICIENT" wrap-principals="false">
+                    <log:login-domain-name>GenericSQLRealm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.GenericHttpHeaderSqlLoginmodule</log:login-module-class>
+                    <log:option name="groupSelect">SELECT username, groupname FROM
genericgroups WHERE username=?</log:option>
+                    <log:option name="dataSourceApplication">null</log:option>
+                    <log:option name="dataSourceName">SampleNoTxDatasource</log:option>
+					<log:option name="headerNames">SM_USER</log:option>
+					<log:option name="authenticationAuthority">Siteminder</log:option>
+                </log:login-module>
+                <!-- Generic HTTP header-based login module for LDAP realm -->
+                <!--<log:login-module control-flag="SUFFICIENT" wrap-principals="false">
+                    <log:login-domain-name>dw-ldap-realm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.GenericHttpHeaderLdapLoginModule</log:login-module-class>
+                    <log:option name="initialContextFactory">com.sun.jndi.ldap.LdapCtxFactory</log:option>
+                    <log:option name="userBase">ou=users,ou=system</log:option>
+                    <log:option name="roleSearchMatching">(uniqueMember={0})</log:option>
+                    <log:option name="userSearchSubtree">false</log:option>
+                    <log:option name="connectionPassword">secret</log:option>
+                    <log:option name="authentication">simple</log:option>
+                    <log:option name="roleBase">ou=groups,ou=system</log:option>
+                    <log:option name="connectionUsername">uid=admin,ou=system</log:option>
+                    <log:option name="connectionURL">ldap://hostname_or_ip:port</log:option>
+                    <log:option name="roleName">cn</log:option>
+                    <log:option name="userSearchMatching">uid={0}</log:option>
+                    <log:option name="roleSearchSubtree">false</log:option>
+					<log:option name="headerNames">SM_USER</log:option>
+					<log:option name="authenticationAuthority">Siteminder</log:option>					
+                </log:login-module>-->
+            </log:login-config>            
+        </xml-reference>
+    </gbean>	
+</web-app>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/web.xml
(added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/web.xml
Mon Nov 22 09:29:21 2010
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+	Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<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">
+
+    <!-- Welcome File List -->
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+
+    <security-constraint>
+      <web-resource-collection>
+        <web-resource-name>Admin Role</web-resource-name>
+        <url-pattern>/protect/*</url-pattern>
+        <http-method>GET</http-method>
+        <http-method>POST</http-method>
+        <http-method>PUT</http-method>        
+      </web-resource-collection>
+      <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>
+
+    <login-config>
+      <auth-method>GENERIC</auth-method>
+      <realm-name>GenericRealm</realm-name>
+    </login-config>
+
+  <security-role>
+      <role-name>content-administrator</role-name>
+  </security-role>  
+
+</web-app>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logon.html
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logon.html?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logon.html
(added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logon.html
Mon Nov 22 09:29:21 2010
@@ -0,0 +1,38 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<HTML>
+<H1>FORM Authentication demo</H1>
+<form method="POST" action="j_security_check">
+<table border="0" cellspacing="2" cellpadding="1">
+<tr>
+  <td>Username:</td>
+  <td><input size="12" value="" name="j_username" maxlength="25" type="text"></td>
+</tr>
+<tr>
+  <td>Password:</td>
+  <td><input size="12" value="" name="j_password" maxlength="25" type="password"></td>
+</tr>
+<tr>
+  <td colspan="2" align="center">
+    <input name="submit" type="submit" value="Login">
+  </td>
+</tr>
+</table>
+</form>
+</HTML>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logon.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logonError.html
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logonError.html?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logonError.html
(added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logonError.html
Mon Nov 22 09:29:21 2010
@@ -0,0 +1,23 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<HTML>
+<H1>Authentication ERROR</H1>
+Username, password or role incorrect.
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;
+</HTML>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/auth/logonError.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/forbidden/hello.html
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/forbidden/hello.html?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/forbidden/hello.html
(added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/forbidden/hello.html
Mon Nov 22 09:29:21 2010
@@ -0,0 +1,21 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<html>
+hello world.
+</html>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/forbidden/hello.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/index.html
(added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/index.html
Mon Nov 22 09:29:21 2010
@@ -0,0 +1,33 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<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.
+        </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>
+    </body>
+</html>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/protect/hello.html
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/protect/hello.html?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/protect/hello.html
(added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/protect/hello.html
Mon Nov 22 09:29:21 2010
@@ -0,0 +1,21 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<html>
+hello world.
+</html>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/generic-auth-war/src/main/webapp/protect/hello.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/samples/branches/2.1/samples/generic-auth/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/generic-auth/pom.xml?rev=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/pom.xml (added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/pom.xml Mon Nov 22 09:29:21 2010
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!-- $Rev: 700247 $ $Date: 2008-09-30 04:47:14 +0800 (周二, 30 九月 2008)
$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.samples</groupId>
+        <artifactId>samples</artifactId>
+        <version>2.1.3-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>generic-auth</artifactId>
+    <name>Geronimo Samples :: generic-auth </name>
+    <packaging>pom</packaging>
+
+    <description>
+        A Sample to demonstrate GENERIC Authentication method, which is http header-based
authentication.
+    </description>
+
+    <modules>
+        <module>generic-auth-war</module>        
+        <module>generic-auth-tomcat</module>
+    </modules>
+
+</project>

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 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=1037643&view=auto
==============================================================================
--- geronimo/samples/branches/2.1/samples/generic-auth/readme.txt (added)
+++ geronimo/samples/branches/2.1/samples/generic-auth/readme.txt Mon Nov 22 09:29:21 2010
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#    
+#     http://www.apache.org/licenses/LICENSE-2.0
+#    
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+Apache Geronimo Samples
+----------------------------------------------------------------------
+
+This sample demonstrates Geronimo HTTP header-based authentication
+
+This README uses the following aliases to describe directories.  These aliases should be
replaced with your actual directory paths.
+   %SAMPLE_HOME% refers to the root directory where Geronimo samples are extracted.
+   %GERONIMO_HOME% refers to the root directory where the Geronimo server is installed.
+   
+
+BUILD
+-----
+1. cd %SAMPLE_HOME%/samples/generic-auth
+2. maven clean install
+
+
+INSTALL
+-------
+1. Start the Geronimo server if it is not already running.
+2. %GERONIMO_HOME%/bin/deploy.[bat|sh] deploy %SAMPLE_HOME%/samples/generic-auth/generic-auth-war/target/generic-auth-war-<version>.war
+   
+
+RUN
+---
+1. Configure Apache HTTP web server with Geronimo server. 
+
+Add these lines to <HTTPD_HOME>/conf/httpd.conf:
+
+LoadModule proxy_module modules/mod_proxy.so
+LoadModule proxy_http_module modules/mod_proxy_http.so
+<IfModule mod_proxy.c>
+ProxyPass /generic-auth http://localhost:8080/generic-auth
+ProxyPassReverse / http://localhost:8080/
+</IfModule>
+
+2. Mimic SiteMinder behavior via mod_headers module.
+
+Add these lines to <HTTPD_HOME>/conf/httpd.conf:
+
+LoadModule headers_module modules/mod_headers.so
+<IfModule mod_headers.c>
+<Location /generic-auth>
+RequestHeader  add  SM_USER	<username>
+</Location>
+</IfModule>
+
+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
+        http://localhost/generic-auth/protect/hello.html
+
+You should see these expected results:        
+izumi -- should see the hello world page with HTTP 200 status
+tom -- should see the hello world page with HTTP 200 status
+alan -- should not see the hello world page with HTTP 403 status
+nobody -- should not see the hello world page with HTTP 401 status
+

Propchange: geronimo/samples/branches/2.1/samples/generic-auth/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message