APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.security.auth.module

public Class NTLoginModule

extends Object
implements LoginModule
Class Inheritance
All Implemented Interfaces
javax.security.auth.spi.LoginModule
Imports
java.util.*, java.io.IOException, javax.security.auth.*, javax.security.auth.callback.*, javax.security.auth.login.*, javax.security.auth.spi.*, java.security.Principal, com.sun.security.auth.NTUserPrincipal, .NTSidUserPrincipal, .NTDomainPrincipal, .NTSidDomainPrincipal, .NTSidPrimaryGroupPrincipal, .NTSidGroupPrincipal, .NTNumericCredential

This LoginModule renders a user's NT security information as some number of Principals and associates them with a Subject.

This LoginModule recognizes the debug option. If set to true in the login Configuration, debug messages will be output to the output stream, System.out.

This LoginModule also recognizes the debugNative option. If set to true in the login Configuration, debug messages from the native component of the module will be output to the output stream, System.out.

Since
1.4
See Also
javax.security.auth.spi.LoginModule

Field Summary

Modifier and TypeField and Description
private CallbackHandler
private boolean
private boolean
private boolean
private NTSidDomainPrincipal
private NTSidGroupPrincipal[]
private NTNumericCredential
private NTSystem
private Map<String, ?>
private NTSidPrimaryGroupPrincipal
private Map<String, ?>
private Subject
private boolean
private NTDomainPrincipal
private NTUserPrincipal
private NTSidUserPrincipal

Constructor Summary

AccessConstructor and Description
public
NTLoginModule()

Creates an NTLoginModule.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

false if this LoginModule's own login and/or commit attempts failed, and true otherwise.
abort
()

Implements javax.security.auth.spi.LoginModule.abort.

This method is called if the LoginContext's overall authentication failed.

public boolean

Returns:

true if this LoginModule's own login and commit attempts succeeded, or false otherwise.
commit
()

Implements javax.security.auth.spi.LoginModule.commit.

This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded).

public void
initialize(Subject
the Subject to be authenticated.
subject
,
CallbackHandler
a CallbackHandler for communicating with the end user (prompting for usernames and passwords, for example). This particular LoginModule only extracts the underlying NT system information, so this parameter is ignored.
callbackHandler
,
Map<String, ?>
shared LoginModule state.
sharedState
,
Map<String, ?>
options specified in the login Configuration for this particular LoginModule.
options
)

Implements javax.security.auth.spi.LoginModule.initialize.

Initialize this LoginModule.

public boolean

Returns:

true in all cases since this LoginModule should not be ignored.
login
()

Implements javax.security.auth.spi.LoginModule.login.

Import underlying NT system identity information.

public boolean

Returns:

true in all cases since this LoginModule should not be ignored.
logout
()

Implements javax.security.auth.spi.LoginModule.logout.

Logout the user.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbackHandlerback to summary
private CallbackHandler callbackHandler
commitSucceededback to summary
private boolean commitSucceeded
debugback to summary
private boolean debug
debugNativeback to summary
private boolean debugNative
domainSIDback to summary
private NTSidDomainPrincipal domainSID
groupsback to summary
private NTSidGroupPrincipal[] groups
iTokenback to summary
private NTNumericCredential iToken
ntSystemback to summary
private NTSystem ntSystem
optionsback to summary
private Map<String, ?> options
primaryGroupback to summary
private NTSidPrimaryGroupPrincipal primaryGroup
sharedStateback to summary
private Map<String, ?> sharedState
subjectback to summary
private Subject subject
succeededback to summary
private boolean succeeded
userDomainback to summary
private NTDomainPrincipal userDomain
userPrincipalback to summary
private NTUserPrincipal userPrincipal
userSIDback to summary
private NTSidUserPrincipal userSID

Constructor Detail

NTLoginModuleback to summary
public NTLoginModule()

Creates an NTLoginModule.

Method Detail

abortback to summary
public boolean abort() throws LoginException

Implements javax.security.auth.spi.LoginModule.abort.

This method is called if the LoginContext's overall authentication failed. (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules did not succeed).

If this LoginModule's own authentication attempt succeeded (checked by retrieving the private state saved by the login and commit methods), then this method cleans up any state that was originally saved.

Returns:boolean

false if this LoginModule's own login and/or commit attempts failed, and true otherwise.

Exceptions
LoginException:
if the abort fails.
commitback to summary
public boolean commit() throws LoginException

Implements javax.security.auth.spi.LoginModule.commit.

This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded).

If this LoginModule's own authentication attempt succeeded (checked by retrieving the private state saved by the login method), then this method associates some number of various Principals with the Subject located in the LoginModuleContext. If this LoginModule's own authentication attempted failed, then this method removes any state that was originally saved.

Returns:boolean

true if this LoginModule's own login and commit attempts succeeded, or false otherwise.

Exceptions
LoginException:
if the commit fails.
initializeback to summary
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options)

Implements javax.security.auth.spi.LoginModule.initialize.

Initialize this LoginModule.

Parameters
subject:Subject

the Subject to be authenticated.

callbackHandler:CallbackHandler

a CallbackHandler for communicating with the end user (prompting for usernames and passwords, for example). This particular LoginModule only extracts the underlying NT system information, so this parameter is ignored.

sharedState:Map<String, ?>

shared LoginModule state.

options:Map<String, ?>

options specified in the login Configuration for this particular LoginModule.

loginback to summary
public boolean login() throws LoginException

Implements javax.security.auth.spi.LoginModule.login.

Import underlying NT system identity information.

Returns:boolean

true in all cases since this LoginModule should not be ignored.

Exceptions
LoginException:
if this LoginModule is unable to perform the authentication.
FailedLoginException:
if the authentication fails.
logoutback to summary
public boolean logout() throws LoginException

Implements javax.security.auth.spi.LoginModule.logout.

Logout the user.

This method removes the NTUserPrincipal, NTDomainPrincipal, NTSidUserPrincipal, NTSidDomainPrincipal, NTSidGroupPrincipals, and NTSidPrimaryGroupPrincipal that may have been added by the commit method.

Returns:boolean

true in all cases since this LoginModule should not be ignored.

Exceptions
LoginException:
if the logout fails.