Class APIAuthenticator


  • public class APIAuthenticator
    extends java.lang.Object
    This class is used to execute a custom, user-defined script that will take care for authentication of the users.
    The user-defined script file path is taken from the Java property with the key name APIEngine.PROP_API_CUSTOM_AUTH
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  APIAuthenticator.Ret
      This class holds the status of the authentication.
      static class  APIAuthenticator.UserData
      This class is a holder for the user credentials.
    • Constructor Summary

      Constructors 
      Constructor Description
      APIAuthenticator​(boolean aCustomScriptEnabled, java.lang.String aScript)
      This constructor creates an instance of the APIAuthenticator class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void performCustomScriptAuthentication​(java.lang.String aUserName, java.lang.String aPassword)
      Performs a user authentication using the provided user credentials.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • APIAuthenticator

        public APIAuthenticator​(boolean aCustomScriptEnabled,
                                java.lang.String aScript)
                         throws DIException
        This constructor creates an instance of the APIAuthenticator class.
        Parameters:
        aCustomScriptEnabled - if this is false a DIException will be thrown because this class is specialized in custom script authentication and this means that the custom script interpretation should be enabled.
        aScript - the script to interpret in order to authenticate the users.
        Throws:
        DIException - if the custom script authentication is disabled
    • Method Detail

      • performCustomScriptAuthentication

        public void performCustomScriptAuthentication​(java.lang.String aUserName,
                                                      java.lang.String aPassword)
                                               throws DIException
        Performs a user authentication using the provided user credentials.
        Parameters:
        aUserName - the user name used for the authentication.
        aPassword - the user password used for the authentication.
        Throws:
        DIException - if the custom script authentication is disabled.
        AuthenticationException - if the user cannot be authenticated.