public class PAM extends Object
Instances are thread unsafe and non reentrant. An instace cannot be reused to authenticate multiple users.
For an overview of PAM programming, refer to the following resources:
Constructor and Description |
---|
PAM(String serviceName)
Creates a new authenticator.
|
Modifier and Type | Method and Description |
---|---|
UnixUser |
authenticate(String username,
String password)
Authenticate the user with a password.
|
void |
dispose()
Performs an early disposal of the object, instead of letting this GC-ed.
|
protected void |
finalize() |
Set<String> |
getGroupsOfUser(String username)
Deprecated.
Pointless and ugly convenience method.
|
public PAM(String serviceName) throws PAMException
serviceName
- PAM service name. This corresponds to the service name that shows up
in the PAM configuration,PAMException
public UnixUser authenticate(String username, String password) throws PAMException
PAMException
- If the authentication fails.public Set<String> getGroupsOfUser(String username) throws PAMException
username
- PAMException
public void dispose()
This method is called by finalize()
, too, so it's not required
to call this method explicitly, however.
Copyright © 2018. All rights reserved.