Apache-AuthCookie

 view release on metacpan or  search on metacpan

t/conf/extra.conf.in  view on Meta::CPAN

  <IfDefine APACHE2>
    <IfDefine !APACHE2_4>
      PerlAuthenHandler Sample::Apache2::AuthCookieHandler->authenticate
      AuthType Sample::Apache2::AuthCookieHandler
      PerlAuthzHandler Sample::Apache2::AuthCookieHandler->authorize
    </IfDefine>
    <IfDefine APACHE2_4>
      PerlAuthenHandler Sample::Apache2_4::AuthCookieHandler->authenticate
      AuthType Sample::Apache2_4::AuthCookieHandler
    </IfDefine>
  </IfDefine>

  <IfDefine !APACHE2_4>
    # apache 1.x, apache 2.0, apache 2.2
    Require dwarf
    Require user programmer
  </IfDefine>
  <IfDefine APACHE2_4>
    # apache 2.4
    <RequireAll>
      Require user programmer
      Require dwarf
    </RequireAll>
  </IfDefine>
</Location>

# test our internal authz_handler for apache 2.4
<Location /docs/myuser>
  AuthName WhatEver

  <IfDefine APACHE1>
    AuthType Sample::Apache::AuthCookieHandler
    PerlAuthenHandler Sample::Apache::AuthCookieHandler->authenticate
    PerlAuthzHandler Sample::Apache::AuthCookieHandler->authorize
  </IfDefine>
  <IfDefine APACHE2>
    <IfDefine !APACHE2_4>
      PerlAuthenHandler Sample::Apache2::AuthCookieHandler->authenticate
      AuthType Sample::Apache2::AuthCookieHandler
      PerlAuthzHandler Sample::Apache2::AuthCookieHandler->authorize
    </IfDefine>
    <IfDefine APACHE2_4>
      PerlAuthenHandler Sample::Apache2_4::AuthCookieHandler->authenticate
      AuthType Sample::Apache2_4::AuthCookieHandler
    </IfDefine>
  </IfDefine>

  <IfDefine !APACHE2_4>
    # apache 1.x, apache 2.0, apache 2.2
    Require user programmer
  </IfDefine>
  <IfDefine APACHE2_4>
    # apache 2.4
    <RequireAll>
      Require myuser dopey programmer
    </RequireAll>
  </IfDefine>
</Location>

<Location /docs/stimeout>
  PerlSetVar WhatEverSessionTimeout +10m
  AuthName WhatEver

  <IfDefine APACHE1>
    AuthType Sample::Apache::AuthCookieHandler
    PerlAuthenHandler Sample::Apache::AuthCookieHandler->authenticate
    PerlAuthzHandler Sample::Apache::AuthCookieHandler->authorize
  </IfDefine>
  <IfDefine APACHE2>
    <IfDefine !APACHE2_4>
      AuthType Sample::Apache2::AuthCookieHandler
      PerlAuthenHandler Sample::Apache2::AuthCookieHandler->authenticate
      PerlAuthzHandler Sample::Apache2::AuthCookieHandler->authorize
    </IfDefine>
    <IfDefine APACHE2_4>
      AuthType Sample::Apache2_4::AuthCookieHandler
      PerlAuthenHandler Sample::Apache2_4::AuthCookieHandler->authenticate
    </IfDefine>
  </IfDefine>

  Require user some-user
  Require user programmer
</Location>

# These documents don't require logging in, but allow it.
<FilesMatch "\.cgi$">
  AuthName WhatEver
  <IfDefine APACHE1>
    AuthType Sample::Apache::AuthCookieHandler
    PerlFixupHandler Sample::Apache::AuthCookieHandler->recognize_user
  </IfDefine>
  <IfDefine APACHE2>
    <IfDefine !APACHE2_4>
      PerlFixupHandler Sample::Apache2::AuthCookieHandler->recognize_user
      AuthType Sample::Apache2::AuthCookieHandler
    </IfDefine>
    <IfDefine APACHE2_4>
      PerlFixupHandler Sample::Apache2_4::AuthCookieHandler->recognize_user
      AuthType Sample::Apache2_4::AuthCookieHandler
      Require all granted
    </IfDefine>
  </IfDefine>
</FilesMatch>

<FilesMatch "\.pl$">
  SetHandler perl-script
  Options +ExecCGI
  AuthName WhatEver
  <IfDefine APACHE1>
    PerlHandler Apache::Registry
    AuthType Sample::Apache::AuthCookieHandler
    PerlFixupHandler Sample::Apache::AuthCookieHandler->recognize_user
  </IfDefine>
  <IfDefine APACHE2>
    PerlResponseHandler ModPerl::Registry
    <IfDefine !APACHE2_4>
      PerlFixupHandler Sample::Apache2::AuthCookieHandler->recognize_user
      AuthType Sample::Apache2::AuthCookieHandler
    </IfDefine>
    <IfDefine APACHE2_4>
      PerlFixupHandler Sample::Apache2_4::AuthCookieHandler->recognize_user



( run in 2.613 seconds using v1.01-cache-2.11-cpan-0bb4e1dffa6 )