Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.acegisecurity.providers.jaas
Class SecurityContextLoginModule

    java.lang.Object
      org.acegisecurity.providers.jaas.SecurityContextLoginModule

All Implemented Interfaces:
  LoginModule

    public class SecurityContextLoginModule

extends Object
implements LoginModule

An implementation of `LoginModule` that uses an Acegi Security `SecurityContext` to provide authentication.
This LoginModule provides opposite functionality to the `JaasAuthenticationProvider` API, and should not really be used in conjunction with it.
The `JaasAuthenticationProvider` allows Acegi to authenticate against Jaas.
The SecurityContextLoginModule allows a Jaas based application to authenticate against Acegi. If there is no Authentication in the `SecurityContextHolder` the login() method will throw a LoginException by default. This functionality can be changed with the `ignoreMissingAuthentication` option by setting it to "true". Setting ignoreMissingAuthentication=true will tell the SecurityContextLoginModule to simply return false and be ignored if the authentication is null.

Author:
  Brian Moseley, Ray Krueger

Constructor Summary
`SecurityContextLoginModule()`

Method Summary
`boolean` | `abort()` Abort the authentication process by forgetting the Acegi Security `Authentication`.
`boolean` | `commit()` Authenticate the `Subject` (phase two) by adding the Acegi Security `Authentication` to the `Subject`'s principals.
`void` | `initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)` Initialize this `LoginModule`.
`boolean` | `login()` Authenticate the `Subject` (phase one) by extracting the Acegi Security `Authentication` from the current `SecurityContext`.
`boolean` | `logout()` Log out the `Subject`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SecurityContextLoginModule

    public SecurityContextLoginModule()

Method Detail

### abort

    public boolean abort()
                  throws LoginException

  Abort the authentication process by forgetting the Acegi Security `Authentication`.

  Specified by:
    `abort` in interface `LoginModule`
  Returns:
    true if this method succeeded, or false if this `LoginModule` should be ignored.
  Throws:
    `LoginException` - if the abort fails

### commit

    public boolean commit()
                   throws LoginException

  Authenticate the `Subject` (phase two) by adding the Acegi Security `Authentication` to the `Subject`'s principals.

  Specified by:
    `commit` in interface `LoginModule`
  Returns:
    true if this method succeeded, or false if this `LoginModule` should be ignored.
  Throws:
    `LoginException` - if the commit fails

### initialize

    public void initialize(Subject subject,
                           CallbackHandler callbackHandler,
                           Map sharedState,
                           Map options)

  Initialize this `LoginModule`. Ignores the callback handler, since the code establishing the `LoginContext` likely won't provide one that understands Acegi Security. Also ignores the `sharedState` and `options` parameters, since none are recognized.

  Specified by:
    `initialize` in interface `LoginModule`
  Parameters:
    `subject` - the `Subject` to be authenticated.

    `callbackHandler` - is ignored
    `sharedState` - is ignored
    `options` - are ignored

### login

    public boolean login()
                  throws LoginException

  Authenticate the `Subject` (phase one) by extracting the Acegi Security `Authentication` from the current `SecurityContext`.

  Specified by:
    `login` in interface `LoginModule`
  Returns:
    true if the authentication succeeded, or false if this `LoginModule` should be ignored.
  Throws:
    `LoginException` - if the authentication fails

### logout

    public boolean logout()
                   throws LoginException

  Log out the `Subject`.

  Specified by:
    `logout` in interface `LoginModule`
  Returns:
    true if this method succeeded, or false if this `LoginModule` should be ignored.
  Throws:
    `LoginException` - if the logout fails

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.