Apache-AppSamurai

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


        * Added nonce and signature to login.pl login form and checking
          in Apache::AppSamurai::login().  All form logins must now provide
          a valid nonce and signature.  This is a Cross Site Request Forgery
          style protection, but since the user is not yet logged in, does
          not ACTUALLY provide CSRF protection.  Instead, it is a additional
          bar to raise and prevent some types of scripted brute force/DoS
          attempts.

        * Added AuthSimple.pm, a authentication module for the
          Authen::Simple authentication framework, which supports
          numerous authentication methods (Kerberos, LDAP, PAM, etc.)

	* Changed Build.PL to attempt to pre-detect mod_perl version
          installed, adding requirement for mod_perl 2 if nothing is
          found

        * Changed Build.PL to attempt to pre-detect cipher module
          for use with Crypt::CBC, adding requirement for
          Crypt::Rijndael if none are found

FAQ  view on Meta::CPAN


Q: "Basic", "Radius", and "Simple"... not a lot of auth choices...
A: Instead of writing 800 auth modules, AppSamurai comes with two basic auth
   modules (that I personally use), plus the AuthSimple module which opens
   up access to any Authen::Simple supported authentication adaptor.
   (Authen::Simple::Kerberos, Authen::Simple::PAM, etc.)  More AppSamurai
   auth modules may appear in future releases.  (Especially if anyone sends
   me code... hint hint.)

Q: I want to write a new auth module to authenticate using a web service
   on my mainframe.  (I will call it AuthWebEBCDIC.) What do I do?
A: About time! Everyone is asking for this one.  Adding an auth module
   is fairly simple.

 * Use the AuthTest.pm test module as your template (from examples/auth/
   in the Apache-AppSamurai dist.)

 * Add any configuration defaults and other pre-initialization to the
   Configure() method.

 * Add any needed initialization code (to connect to the web service or

examples/htdocs/login.html  view on Meta::CPAN

    td.infoboxbot
    {
    width: 100%;
    }

    -->
    /*]]>*/
    </style>
    <script language="JavaScript" type="text/javascript">
    //<![CDATA[
    <!-- // Escape from frames and load as the top page
    if (window != top) top.location.href = location.href;
    // -->
    //]]>
    </script>
  </head>
  <body onload="document.forms[0].credential_0.focus()">
    <table summary="" align="center" border="0" cellspacing="0" cellpadding="0" class="outertable">
      <tr>
        <td align="left" valign="bottom">
          <!-- Replace with your logo, whatever -->

lib/Apache/AppSamurai.pm  view on Meta::CPAN


Unauthenticated users are presented with either a login form, or a basic
authentication popup (depending on configuration.)  User supplied credentials
are checked against one or more authentication systems before the user's
session is created and a session authentication cookie is passed back to the
browser.  Only authenticated and authorized requests are proxied through
to the backend server.

Apache::AppSamurai is based on, and includes some code from,
L<Apache::AuthCookie|Apache::AuthCookie>.
Upon that core is added a full authentication and session handling framework.
(No coding required.)  Features include:

=over 4

=item *

B<Modular authentication> - Uses authentication sub-modules for the easy
addition custom authentication methods

=item *

lib/Apache/AppSamurai.pm  view on Meta::CPAN

by the authentication modules shipped with AppSamurai, and is not
available as an add on module, please review L<Apache::AppSamurai::AuthBase>
and use the skeletal code from AuthTest.pm, which is included under
/examples/auth/ in the AppSamurai distribution.

=head2 SESSION CONFIGURATION

Each Apache::AppSamurai instance must have its local (proxy server side)
session handling defined.
L<Apache::Session|Apache::Session> provides the majority of the session
framework.  Around Apache::Session is wrapped
L<Apache::AppSamurai::Session|Apache::AppSamurai::Session>, which
adds features to allow for more flexible selection of sub-modules.

Most Apache::Session style configuration options can be passed directly to the
session system by prefixing them with C<authnameSession>.

Module selection is slightly different than the default supplied with
Apache::Session.  Plain names, without any path or ::, are handled
exactly the same: Modules are loaded from within the Apache::Session
tree.  Two additional alternatives are provided:

lib/Apache/AppSamurai/AuthBase.pm  view on Meta::CPAN


All L<Apache::AppSamurai|Apache::AppSamurai> authentication modules should
inherit from this base module.  This module is never used directly.
See L<Apache::AppSamurai|Apache::AppSamurai> for details on authentication
module config and use within AppSamurai.                

=head1 DESCRIPTION

All L<Apache::AppSamurai|Apache::AppSamurai> authentication submodules
should inherit from Auth::Base.  This module provides the a standard
framework including config, initialization, basic input validation and
filtering, error checking, and logging needed by all AppSamurai auth modules.

Auth modules must each define at least an L</Authenticator()> method to accept
the username (C<credential_0>) and the mapped credential (password) and return
0 on failure and 1 on success.  Other commonly overridden methods are
L</Configure()> which includes the setup of the C< $self->{conf} >
configuration hash, and L</Initialize()> which performs any needed
pre-authentication setup work.

=head1 METHODS

lib/Apache/AppSamurai/AuthSimple.pm  view on Meta::CPAN

# Apache::AppSamurai::AuthSimple - AppSamurai "Simple" authentication framework
#                                  plugin

# $Id: AuthSimple.pm,v 1.2 2008/05/01 22:36:10 pauldoom Exp $

##
# Copyright (c) 2008 Paul M. Hirsch (paul@voltagenoir.org).
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it under
# the same terms as Perl itself.

lib/Apache/AppSamurai/AuthSimple.pm  view on Meta::CPAN


    $self->AddError($severity, $msg);
}

1; # End of Apache::AppSamurai::AuthSimple

__END__

=head1 NAME

Apache::AppSamurai::AuthSimple - Check credentials with Authen::Simple framework

=head1 SYNOPSIS

The module is selected and configured inside the Apache configuration.

 # Example with an authname of "fred" for use as part of an Apache config.

 # Configure as an authentication method (Authen::Simple::Passwd shown)
 PerlSetVar fredAuthMethods "AuthSimplePasswd"

 # Set auth method options (Authen::Simple::Passwd "path" option shown)
 PerlSetVar fredAuthSimplePasswdpath "/var/www/conf/passwordfile"

=head1 DESCRIPTION

This L<Apache::AppSamurai|Apache::AppSamurai> authentication module checks a
username and password using the Authen::Simple auth framework and a supported
Authen::Simple::XXX adaptor module. If this sounds confusing, read on and
examine the examples.

This module opens up authentication access to a wide array of options including
PAM, LDAP, Kerberos, and even SSH.

=head1 USAGE

Basic L<Apache::AppSamurai::AuthBase|Apache::AppSamurai::AuthBase>
configuration options are supported.  Additional options are described



( run in 0.777 second using v1.01-cache-2.11-cpan-df04353d9ac )