
####
Auth
####


****
NAME
****


Kernel::System::Auth - agent authentication module.


***********
DESCRIPTION
***********


The authentication module for the agent interface.


****************
PUBLIC INTERFACE
****************


new()
=====


Don't use the constructor directly, use the ObjectManager instead:


.. code-block:: perl

     my $AuthObject = $Kernel::OM->Get('Kernel::System::Auth');



GetOption()
===========


Get module options. Currently there is just one option, "PreAuth".


.. code-block:: perl

     my $AuthOption = $AuthObject->GetOption(What => 'PreAuth');
 
     # or
 
     if ( $AuthObject->GetOption(What => 'PreAuth') ) {
         print "No login screen is needed. Authentication is based on some other options. E. g. $ENV{REMOTE_USER}\n";
     }



Auth()
======


The authentication function.


.. code-block:: perl

     my $User = $AuthObject->Auth(
         User => $User,
         Pw   => $Pw,
     );
 
     # or
 
     if ( $AuthObject->Auth( User => $User, Pw => $Pw ) ) {
         print "Auth ok!\n";
     }
     else {
         print "Auth invalid!\n";
     }



GetLastErrorMessage()
=====================


Retrieve $Self->{LastErrorMessage} content.


.. code-block:: perl

     my $AuthErrorMessage = $AuthObject->GetLastErrorMessage();


Result:


.. code-block:: perl

     $AuthErrorMessage = "An error string message.";





