Apache2-AuthAny

 view release on metacpan or  search on metacpan

lib/Apache2/AuthAny.pm  view on Meta::CPAN

package Apache2::AuthAny;

use strict;
use Data::Dumper qw(Dumper);
use Apache2::Module ();
use Apache2::ServerUtil ();
use Apache2::Const -compile => qw(OR_AUTHCFG TAKE1 TAKE2 OR_ALL FLAG ITERATE :log);


=head1 NAME

Apache2::AuthAny - Authentication with any provider or mechanism

=head1 VERSION

Version 0.201

=cut

our $VERSION = '0.201';

=head1 SYNOPSIS

Apache configuration ...

 PerlSetEnv AUTH_ANY_ROOT       /usr/share/authany
 PerlSetEnv AUTH_ANY_CONFIG_ROOT  /etc/authany
 PerlSetEnv AUTH_ANY_DB         mysql
 PerlSetEnv AUTH_ANY_DB_PW_FILE /etc/authany/db-passwd
 PerlSetEnv AUTH_ANY_DB_USER    authany
 PerlSetEnv AUTH_ANY_DB_NAME    auth_any
 #PerlSetEnv AUTH_ANY_DB_HOST    remote_host_if_needed
 
 PerlRequire              /usr/share/authany/startup.pl
 PerlLoadModule Apache2::AuthAny

 <VirtualHost *:443>
	DocumentRoot /var/www/htdocs
        ...

        # for Apache2::AuthAny
	<Location /aa_auth/basic*/*>
              AuthType Basic
              AuthName AABasic
              AuthUserFile /etc/authany/config/htpasswd
              Require valid-user
	</Location>

	<Location /aa_auth/uw>
            AuthType shibboleth
            ShibRequireSessionWith UW
            ShibRequestSetting forceAuthn 1
            Require valid-user
	</Location>
        # ...
 </VirtualHost>

Contents of /var/www/htdocs/private/.htaccess

 AuthType auth-any
 AuthAnyGateURL /our-gate/gate.php
 Require role our_project_administrators
 Require user john_the_ceo



( run in 0.553 second using v1.01-cache-2.11-cpan-39bf76dae61 )