org.eclipse.jetty.security

## Class SpnegoLoginService

- java.lang.Object
- - org.eclipse.jetty.util.component.AbstractLifeCycle
  - - org.eclipse.jetty.security.SpnegoLoginService

- All Implemented Interfaces:
    LoginService, LifeCycle

      public class SpnegoLoginService
      extends AbstractLifeCycle
      implements LoginService

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `AbstractLifeCycle.AbstractLifeCycleListener`

    - ### Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

      `LifeCycle.Listener`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected IdentityService` | `_identityService`
    `protected String` | `_name`

    - ### Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpnegoLoginService()`
    `SpnegoLoginService(String name)`
    `SpnegoLoginService(String name, String config)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doStart()`
    `String` | `getConfig()`
    `IdentityService` | `getIdentityService()` Get the IdentityService associated with this Login Service.
    `String` | `getName()`
    `UserIdentity` | `login(String username, Object credentials)` username will be null since the credentials will contain all the relevant info
    `void` | `logout(UserIdentity user)`
    `void` | `setConfig(String config)`
    `void` | `setIdentityService(IdentityService service)` Set the IdentityService associated with this Login Service.
    `void` | `setName(String name)`
    `boolean` | `validate(UserIdentity user)` Validate a user identity.

    - ### Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

      `addLifeCycleListener, doStop, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

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

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

- - ### Field Detail

    - #### _identityService

          protected IdentityService _identityService

    - #### _name

          protected String _name

  - ### Constructor Detail

    - #### SpnegoLoginService

          public SpnegoLoginService()

    - #### SpnegoLoginService

          public SpnegoLoginService(String name)

    - #### SpnegoLoginService

          public SpnegoLoginService(String name,
                            String config)

  - ### Method Detail

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `LoginService`
      Returns:
        Get the name of the login service (aka Realm name)

    - #### setName

          public void setName(String name)

    - #### getConfig

          public String getConfig()

    - #### setConfig

          public void setConfig(String config)

    - #### doStart

          protected void doStart()
                          throws Exception

      Overrides:
        `doStart` in class `AbstractLifeCycle`
      Throws:
        `Exception`

    - #### login

          public UserIdentity login(String username,
                           Object credentials)

      username will be null since the credentials will contain all the relevant info
      Specified by:
        `login` in interface `LoginService`
      Parameters:
        `username` - The user name
        `credentials` - The users credentials
      Returns:
        A UserIdentity if the credentials matched, otherwise null

    - #### validate

          public boolean validate(UserIdentity user)

      Description copied from interface: `LoginService`
      Validate a user identity. Validate that a UserIdentity previously created by a call to `LoginService.login(String, Object)` is still valid.
      Specified by:
        `validate` in interface `LoginService`
      Parameters:
        `user` - The user to validate
      Returns:
        true if authentication has not been revoked for the user.

    - #### getIdentityService

          public IdentityService getIdentityService()

      Description copied from interface: `LoginService`
      Get the IdentityService associated with this Login Service.
      Specified by:
        `getIdentityService` in interface `LoginService`
      Returns:
        the IdentityService associated with this Login Service.

    - #### setIdentityService

          public void setIdentityService(IdentityService service)

      Description copied from interface: `LoginService`
      Set the IdentityService associated with this Login Service.
      Specified by:
        `setIdentityService` in interface `LoginService`
      Parameters:
        `service` - the IdentityService associated with this Login Service.

    - #### logout

          public void logout(UserIdentity user)

      Specified by:
        `logout` in interface `LoginService`

Copyright © 1995-2016 Mort Bay Consulting. All Rights Reserved.