com.sun.grid.security.login
public class UnixLoginModule extends java.lang.Object implements javax.security.auth.spi.LoginModule
LoginModule
authenticates a unix user with username
and password against the PAM or system authentication system.
The username is queried with a NameCallback
, the password with
a PasswordCallback
After a successfull login this LoginModule
adds
com.sun.security.auth.UnixPrincipal
of the authenticated usercom.sun.security.auth.UnixNumericUserPrincipal
with the user id
of the authenticated usercom.sun.security.auth.UnixNumericGroupPrincipal
for each group the authenticated
user belongs tooThis class uses a Logger
for log messages. The name of the Logger
is equal to the fullqualified classname of this class.
Option | description |
---|---|
sge_root | path to the gridengine distribution |
auth_method | Autehtication method. Valid values are "pam" and "system" |
pam_service | Name of the pam service (see man pam(5). Required for PAM authentifcation |
sample { com.sun.grid.security.login.UnixLoginModule requisite sge_root="/opt/sge", auth_method="pam"; pam_service="su"; };
sample { com.sun.grid.security.login.UnixLoginModule requisite command="/opt/sge", auth_method="system"; };
Constructor and Description |
---|
UnixLoginModule() |
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
Abort the login.
|
boolean |
commit()
Commit the login (adds the principals to the subject)
|
void |
initialize(javax.security.auth.Subject subject,
javax.security.auth.callback.CallbackHandler callbackHandler,
java.util.Map sharedState,
java.util.Map options)
Initialize the
UnixLoginModule |
boolean |
login()
Perform the login.
|
boolean |
logout()
Removes all previously added prinicipals from the subject.
|
public void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map sharedState, java.util.Map options)
UnixLoginModule
initialize
in interface javax.security.auth.spi.LoginModule
subject
- the current subjectcallbackHandler
- the callbackhandler (must at least handle a
NameCallback
and a
PasswordCallback).sharedState
- not usedoptions
- contains the options for the UnixLoginModule
.public boolean login() throws javax.security.auth.login.LoginException
login
in interface javax.security.auth.spi.LoginModule
true
on successfull authentication. false
if username of password is invalid.javax.security.auth.login.LoginException
- public boolean commit()
commit
in interface javax.security.auth.spi.LoginModule
true
of the principals has been added to the subject.public boolean abort()
abort
in interface javax.security.auth.spi.LoginModule
true
public boolean logout()
logout
in interface javax.security.auth.spi.LoginModule
true