Lemonldap::NG::Handler::CGI - Perl extension for using Lemonldap::NG authentication in Perl CGI without using Lemonldap::NG::Handler


  use Lemonldap::NG::Handler::CGI;
  my $cgi = Lemonldap::NG::Handler::CGI->new ( {
      # Local storage used for sessions and configuration
      localStorage        => "Cache::DBFile",
      localStorageOptions => {...},
      # How to get my configuration
      configStorage       => {
          type                => "DBI",
          dbiChain            => "DBI:mysql:database=lemondb;host=$hostname",
          dbiUser             => "lemonldap",
          dbiPassword          => "password",
      https               => 0,
  # Lemonldap::NG cookie validation
  # Optionnal Lemonldap::NG authorization
  # See CGI(3) for more about writing HTML pages
  print $cgi->header;
  print $cgi->start_html;
  # Since authentication phase, you can use user attributes and macros
  my $name = $cgi->user->{cn};
  # Instead of using "$cgi->user->{groups} =~ /\badmin\b/", you can use
  if( $cgi->group('admin') ) {
    # special html code for admins
  else {
    # another HTML code


Lemonldap::NG::Handler provides the protection part of Lemonldap::NG web-SSO system. It can be used with any system used with Apache (PHP or JSP pages for example). If you need to protect only few Perl CGI, you can use this library instead.

Warning, this module must not be used in a Lemonldap::NG::Handler protected area because it hides Lemonldap::NG cookies.

SEE ALSO, CGI, Lemonldap::NG::Handler, Lemonldap::NG::Manager, Lemonldap::NG::Portal


Xavier Guimard, <>


Use OW2 system to report bug or ask for features:


Lemonldap::NG is available at


Copyright (C) 2007 by Xavier Guimard

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.