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


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"


This 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.


Basic Apache::AppSamurai::AuthBase configuration options are supported. Additional options are described below. The following must be preceded by the auth name and the auth module name, AuthSimple, followed by the adaptor submodule for Authen::Simple to use, and finally the name of the parameter to set. (This will end up being passed directly to the adaptor submodule.)

For example, if you wish to set the Authen::Simple::Kerberos realm value for the authname "Jerry", you would use:

 PerlSetVar JerryAuthSimpleKerberosrealm "REALM.REALMY.COM"

Note that the configuration key, "realm", is in all lower case to match the key Authen::Simple::Kerberos expects.

Here is another example, this time setting the Authen::Simple::LDAP and the authname "GRAVY":

 PerlSetVar GRAVYAuthSimpleLDAPhost ""
 PerlSetVar GRAVYAuthSimpleLDAPbasedn "ou=People,dc=lovemesomeldap,dc=org"

Check the documentation for the specific Authen::Simple adaptor you wish to use for a list of configuration parameters. All parameters that can be passed to the new constructor of the adaptor module can be set, with the exception of the log parameter which is handled by Apache::AppSamurai::AuthSimple directly.

See Apache::AppSamurai for more general configuration information, or the examples/conf/ directory in the Apache::AppSamurai distribution for examples.



Primarily a wrapper for the AuthBase Configure() method, with the addition of code to point all adaptor submodule logging back to Apache::AppSamurai::AuthSimple for handling. This overrides the default logging behaviour for Authen::Simple adaptors, which is to send log messages to STDERR.


Performs the following additional actions:

  • Attempts to load the configured Authen::Simple adaptor submodule

  • Creates a new Authen::Simple instance with the configured adaptor submodule


Sends the authentication request to the Authen::Simple instance, which in turn sends the request to the configured adaptor submodule. It logs error(s) and/or warnings and returns 0 if the authentication fails for any reason.

debug(), info(), warn(), error()

Logging callback methods used by Authen::Simple to log to. All methods use Apache::AppSamurai::AuthBase::AddError() to push messages onto the log stack.


See "USAGE" for basic examples, or configuration examples in examples/conf/ inside the Apache::AppSamurai distribution.


Apache::AppSamurai, Apache::AppSamurai::AuthBase, Authen::Simple


Paul M. Hirsch, <paul at>


See Apache::AppSamurai for information on bug submission and tracking.


See Apache::AppSamurai for support information.


Copyright 2008 Paul M. Hirsch, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.