Package waffle.jaas
Class WindowsLoginModule
- java.lang.Object
-
- waffle.jaas.WindowsLoginModule
-
- All Implemented Interfaces:
LoginModule
public class WindowsLoginModule extends Object implements LoginModule
A Java Security login module for Windows authentication.- Author:
- dblock[at]dblock[dot]org
- See Also:
LoginModule
-
-
Constructor Summary
Constructors Constructor Description WindowsLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabort()Abort a login process.booleancommit()Commit principals to the subject.IWindowsAuthProvidergetAuth()Windows auth provider.voidinitialize(Subject initSubject, CallbackHandler initCallbackHandler, Map<String,?> initSharedState, Map<String,?> initOptions)booleanisAllowGuestLogin()True if Guest login permitted.booleanisDebug()True if Debug is enabled.booleanlogin()Use Windows SSPI to authenticate a username with a password.booleanlogout()Logout a user.voidsetAllowGuestLogin(boolean value)Set whether Guest login is permitted.voidsetAuth(IWindowsAuthProvider provider)Set Windows auth provider.
-
-
-
Method Detail
-
initialize
public void initialize(Subject initSubject, CallbackHandler initCallbackHandler, Map<String,?> initSharedState, Map<String,?> initOptions)
- Specified by:
initializein interfaceLoginModule
-
login
public boolean login() throws LoginExceptionUse Windows SSPI to authenticate a username with a password.- Specified by:
loginin interfaceLoginModule- Returns:
- true, if successful
- Throws:
LoginException- the login exception
-
abort
public boolean abort() throws LoginExceptionAbort a login process.- Specified by:
abortin interfaceLoginModule- Returns:
- true, if successful
- Throws:
LoginException- the login exception
-
commit
public boolean commit() throws LoginExceptionCommit principals to the subject.- Specified by:
commitin interfaceLoginModule- Returns:
- true, if successful
- Throws:
LoginException- the login exception
-
logout
public boolean logout() throws LoginExceptionLogout a user.- Specified by:
logoutin interfaceLoginModule- Returns:
- true, if successful
- Throws:
LoginException- the login exception
-
isDebug
public boolean isDebug()
True if Debug is enabled.- Returns:
- True or false.
-
getAuth
public IWindowsAuthProvider getAuth()
Windows auth provider.- Returns:
- IWindowsAuthProvider.
-
setAuth
public void setAuth(IWindowsAuthProvider provider)
Set Windows auth provider.- Parameters:
provider- Class implements IWindowsAuthProvider.
-
isAllowGuestLogin
public boolean isAllowGuestLogin()
True if Guest login permitted.- Returns:
- True if Guest login permitted, false otherwise.
-
setAllowGuestLogin
public void setAllowGuestLogin(boolean value)
Set whether Guest login is permitted. Default is true, if the Guest account is enabled, an invalid username/password results in a Guest login.- Parameters:
value- True or false.
-
-