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

Modifier and Type
Method
Description
`boolean`
`abort()`
Abort a login process.
`boolean`
`commit()`
Commit principals to the subject.
`IWindowsAuthProvider`
`getAuth()`
Windows auth provider.
`void`
`initialize(Subject initSubject, CallbackHandler initCallbackHandler, Map<String,?> initSharedState, Map<String,?> initOptions)`
`boolean`
`isAllowGuestLogin()`
True if Guest login permitted.
`boolean`
`isDebug()`
True if Debug is enabled.
`boolean`
`login()`
Use Windows SSPI to authenticate a username with a password.
`boolean`
`logout()`
Logout a user.
`void`
`setAllowGuestLogin(boolean value)`
Set whether Guest login is permitted.
`void`
`setAuth(IWindowsAuthProvider provider)`
Set Windows auth provider.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WindowsLoginModule

public WindowsLoginModule()

## Method Details

### initialize

public void initialize(Subject initSubject, CallbackHandler initCallbackHandler, Map<String,?> initSharedState, Map<String,?> initOptions)

Specified by:
  `initialize` in interface `LoginModule`

### login

public boolean login() throws LoginException
Use Windows SSPI to authenticate a username with a password.

Specified by:
  `login` in interface `LoginModule`
Returns:
  true, if successful
Throws:
  `LoginException` - the login exception

### abort

public boolean abort() throws LoginException
Abort a login process.

Specified by:
  `abort` in interface `LoginModule`
Returns:
  true, if successful
Throws:
  `LoginException` - the login exception

### commit

public boolean commit() throws LoginException
Commit principals to the subject.

Specified by:
  `commit` in interface `LoginModule`
Returns:
  true, if successful
Throws:
  `LoginException` - the login exception

### logout

public boolean logout() throws LoginException
Logout a user.

Specified by:
  `logout` in interface `LoginModule`
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.