com.sun.grid.security.login

## Class TestLoginModule

- java.lang.Object
- - com.sun.grid.security.login.TestLoginModule

- All Implemented Interfaces:
    javax.security.auth.spi.LoginModule

      public class TestLoginModule
      extends java.lang.Object
      implements javax.security.auth.spi.LoginModule

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TestLoginModule()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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 `TestLoginModule`
    `boolean` | `login()` Perform the login.
    `boolean` | `logout()` Removes all previously added prinicipals from the subject.

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

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

- - ### Constructor Detail

    - #### TestLoginModule

          public TestLoginModule()

  - ### Method Detail

    - #### initialize

          public void initialize(javax.security.auth.Subject subject,
                                 javax.security.auth.callback.CallbackHandler callbackHandler,
                                 java.util.Map sharedState,
                                 java.util.Map options)

      Initialize the `TestLoginModule`
      Specified by:
        `initialize` in interface `javax.security.auth.spi.LoginModule`
      Parameters:
        `subject` - the current subject
        `callbackHandler` - the callbackhandler (must at least handle a `NameCallback` and a PasswordCallback).
        `sharedState` - not used
        `options` - contains the options for the `TestLoginModule`.

    - #### login

          public boolean login()
                        throws javax.security.auth.login.LoginException

      Perform the login.
      Specified by:
        `login` in interface `javax.security.auth.spi.LoginModule`
      Returns:
        `true` on successfull authentication. `false` if username of password is invalid.
      Throws:
        `javax.security.auth.login.LoginException` -
        - if the callbackhandler reports an error
        - if some options are missing (please check the jass.config file)
        - if the underlying authentication system report an error

    - #### commit

          public boolean commit()

      Commit the login (adds the principals to the subject)
      Specified by:
        `commit` in interface `javax.security.auth.spi.LoginModule`
      Returns:
        `true` of the principals has been added to the subject.

    - #### abort

          public boolean abort()

      Abort the login.
      Specified by:
        `abort` in interface `javax.security.auth.spi.LoginModule`
      Returns:
        Always `true`

    - #### logout

          public boolean logout()

      Removes all previously added prinicipals from the subject.
      Specified by:
        `logout` in interface `javax.security.auth.spi.LoginModule`
      Returns:
        Always `true`