Demonstrate GENERIC authentication

This sample defines one security realm with two new login modules:

There is another new login module for LDAP authentication: org.apache.geronimo.security.realm.providers.GenericHttpHeaderLdapLoginModule. 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.

Follow these steps to run this sample:

  1. Configure Apache HTTP web server to proxy HTTP request for Geronimo server.

    Add these lines to APACHE_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 APACHE_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 one by one: izumi, tom, alan, nobody

    izumi is a valid user defined in file property "var/security/demo_groups.properties" with manager role.
    tom is a valid user defined in SQL login module with manager role.
    alan is a valid user defined in SQL login module without manager role.
    nobody is not a valid user in any security login module.

  3. Change the username field as above, restart Apache HTTP server, then visit this link.