4.1.9. AuthorisedHook Previous topic Parent topic Child topic Next topic

This is a Perl hook, which is called when the client is authenticated and authorised with location update, before the EAP Success message is sent. AuthorisedHook is called with 5 arguments:
  • $_[0]
    This is a pointer to this AuthBy.
  • $_[1]
    This is a pointer to the current EAP context structure of the current user.
  • $_[2]
    This is a pointer to the last request from the client.
  • $_[3]
    This is a pointer to the authentication result. It is preset to main::ACCEPT but it can be changed if needed.
  • $_[4]
    This is a pointer to the authentication reason. It is preset to empty string but it can be changed if needed.
CAUTION
When UpdateLocation is enabled, the received profile is available in EAP context but it's exact contents and presentation may still change.
# Log IMSI and the profile that was fetch with authorisation
AuthorisedHook sub { \
    my $self = $_[0]; my $context = $_[1]; my $p = $_[2]; \

    use Data::Dumper; $Data::Dumper::Sortkeys = 1; $Data::Dumper::Useqq = 1; \
    $self->log($main::LOG_DEBUG, "Profile for IMSI $context->{imsi}: " . \
                                  Dumper($context->{sim_profile}), $p); \
}