Package net.sf.jpam

Class Pam

java.lang.Object
net.sf.jpam.Pam

public class Pam extends Object
The PAM bridging class. Most of the work is done here.

To see debugging output for this class and native code, set the installed logging toolkit level for this class to DEBUG or equivalent. The debugging output for the native code will be sent to STDOUT.

This class may be called directly, or by using JAAS, via the JpamLoginModule.

Version:
$Id: Pam.java 32 2013-08-28 10:55:33Z rcbiczok $
Author:
Greg Luck, David Lutterkort, RedHat, Ken Huffman
  • Field Details

    • DEFAULT_SERVICE_NAME

      public static final String DEFAULT_SERVICE_NAME
      The default service name of "net-sf-pam".

      This service is expected to be configured in /etc/pam.d

      See Also:
  • Constructor Details

  • Method Details

    • authenticateSuccessful

      public boolean authenticateSuccessful(String username, String credentials)
      Authenticates a user.

      This method is threadsafe.

      If the logging toolkit is set to DEBUG, the shared library will emit debug information to the console.

      Parameters:
      username - the username to be authenticated
      credentials - the credentials to use in the authentication .e.g a password
      Returns:
      true if the PamReturnValue is PamReturnValue.PAM_SUCCESS
    • authenticate

      public PamReturnValue authenticate(String username, String credentials) throws NullPointerException
      Sames as authenticateSuccessful, except a PamReturnValue is returned

      This method is threadsafe.

      Parameters:
      username -
      credentials -
      Returns:
      a PAM specific return value
      Throws:
      NullPointerException - if any of the parameters are null
      See Also:
    • main

      public static void main(String[] args)
      A main method
    • getLibraryName

      public static String getLibraryName()
      Returns:
      the system dependent name of the shared library the Pam class is expecting.
    • getServiceName

      public String getServiceName()
      Returns:
      the servicename this PAM object is using