Unable to authenticate with rlm_perl

A.L.M.Buxey at lboro.ac.uk A.L.M.Buxey at lboro.ac.uk
Wed Apr 2 16:22:36 CEST 2008


Hi,

> client. For the testing purpose I've put this simple script in the perl
> program
> 
> if ($RAD_REQUEST{'User-Name'} eq "john")
>               {
>                      $RAD_REPLY{'A message'} = " Accepting John";
>                      return RLM_MODULE_OK;
> 
>                }
>              else
>               {
>                      $RAD_REPLY{'A message'} = "Rececting users";
>                      return RLM_MODULE_REJECT;
>               }

and in which subroutine is this sat? and are you calling perl
for that subroutine?  freeradius is also spewing out that your
perl example.pm has an error in in.  this basic example
might work for you

# examplev2 - version 0.0.1a
# Author:  Alan Buxey
# Date:   02/04/2008
# (c) alan buxey 2008 - you may modify/reuse this code so long
# as the known origin is marked - licenced under GPL etc

use strict;
use vars qw(%RAD_REQUEST %RAD_REPLY %RAD_CHECK);

use constant    RLM_MODULE_REJECT=>    0;#  /* immediately reject the request */
use constant    RLM_MODULE_FAIL=>      1;#  /* module failed, don't reply */
use constant    RLM_MODULE_OK=>        2;#  /* the module is OK, continue */
use constant    RLM_MODULE_HANDLED=>   3;#  /* the module handled the request, so stop. */
use constant    RLM_MODULE_INVALID=>   4;#  /* the module considers the request invalid. */
use constant    RLM_MODULE_USERLOCK=>  5;#  /* reject the request (user is locked out) */
use constant    RLM_MODULE_NOTFOUND=>  6;#  /* user not found */
use constant    RLM_MODULE_NOOP=>      7;#  /* module succeeded without doing anything */
use constant    RLM_MODULE_UPDATED=>   8;#  /* OK (pairs modified) */
use constant    RLM_MODULE_NUMCODES=>  9;#  /* How many return codes there are */

sub authorize {

if ($RAD_REQUEST{'User-Name'} eq "john")
              {
                     $RAD_REPLY{'Reply-Message'} = " Accepting John";
                     return RLM_MODULE_OK;

               }
             else
              {
                     $RAD_REPLY{'Reply-Message'} = "Rejcecting users";
                     return RLM_MODULE_REJECT;
              }

# end of the authorize subsection

}

alan



More information about the Freeradius-Users mailing list