Package net.sf.jpam
Class Pam
java.lang.Object
net.sf.jpam.Pam
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPam()
Creates a new Pam object configured to use theDEFAULT_SERVICE_NAME
Creates a new PAM object configured with the specified service name. -
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(String username, String credentials) Sames asauthenticateSuccessful
, except aPamReturnValue
is returnedboolean
authenticateSuccessful
(String username, String credentials) Authenticates a user.static String
static void
A main method
-
Field Details
-
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
-
Pam
public Pam()Creates a new Pam object configured to use theDEFAULT_SERVICE_NAME
-
Pam
Creates a new PAM object configured with the specified service name. A file with the same name must exist in /etc/pam.d- Parameters:
serviceName
-- Throws:
NullPointerException
IllegalArgumentException
-
-
Method Details
-
authenticateSuccessful
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 authenticatedcredentials
- the credentials to use in the authentication .e.g a password- Returns:
- true if the
PamReturnValue
isPamReturnValue.PAM_SUCCESS
-
authenticate
Sames asauthenticateSuccessful
, except aPamReturnValue
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
A main method -
getLibraryName
- Returns:
- the system dependent name of the shared library the Pam class is expecting.
-
getServiceName
- Returns:
- the servicename this PAM object is using
-