org.eclipse.net4j.util.security

## Class UserManagerAuthenticator

- java.lang.Object
- - org.eclipse.net4j.util.event.Notifier
  - - org.eclipse.net4j.util.lifecycle.Lifecycle
    - - org.eclipse.net4j.util.security.UserManagerAuthenticator

- All Implemented Interfaces:
    INotifier, IDeactivateable, ILifecycle, ILifecycle.DeferrableActivation, IAuthenticator

      public class UserManagerAuthenticator
      extends Lifecycle
      implements IAuthenticator

  Since:
    3.3
  Author:
    Eike Stepper

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle

      `ILifecycle.DeferrableActivation`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_TOKEN_LENGTH`

    - ### Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `USE_LABEL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserManagerAuthenticator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `authenticate(java.lang.String userID, char[] password)` Authenticates the user with the passed `userID` by checking whether the supplied `password` matches the password stored for this user.
    `protected byte[]` | `createRandomToken()`
    `protected void` | `doActivate()`
    `protected void` | `doBeforeActivate()`
    `java.lang.String` | `getEncryptionAlgorithmName()`
    `int` | `getEncryptionIterationCount()`
    `byte[]` | `getEncryptionSaltBytes()`
    `IRandomizer` | `getRandomizer()`
    `int` | `getTokenLength()`
    `IUserManager` | `getUserManager()`
    `void` | `setEncryptionAlgorithmName(java.lang.String encryptionAlgorithmName)`
    `void` | `setEncryptionIterationCount(int encryptionIterationCount)`
    `void` | `setEncryptionSaltBytes(byte[] encryptionSaltBytes)`
    `void` | `setRandomizer(IRandomizer randomizer)`
    `void` | `setTokenLength(int tokenLength)`
    `void` | `setUserManager(IUserManager userManager)`

    - ### Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

      `activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString`

    - ### Methods inherited from class org.eclipse.net4j.util.event.Notifier

      `addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener`

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

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

    - ### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

      `addListener, getListeners, hasListeners, removeListener`

- - ### Field Detail

    - #### DEFAULT_TOKEN_LENGTH

          public static final int DEFAULT_TOKEN_LENGTH

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### UserManagerAuthenticator

          public UserManagerAuthenticator()

  - ### Method Detail

    - #### getEncryptionAlgorithmName

          public java.lang.String getEncryptionAlgorithmName()

    - #### setEncryptionAlgorithmName

          public void setEncryptionAlgorithmName(java.lang.String encryptionAlgorithmName)

    - #### getEncryptionSaltBytes

          public byte[] getEncryptionSaltBytes()

    - #### setEncryptionSaltBytes

          public void setEncryptionSaltBytes(byte[] encryptionSaltBytes)

    - #### getEncryptionIterationCount

          public int getEncryptionIterationCount()

    - #### setEncryptionIterationCount

          public void setEncryptionIterationCount(int encryptionIterationCount)

    - #### getTokenLength

          public int getTokenLength()

    - #### setTokenLength

          public void setTokenLength(int tokenLength)

    - #### getRandomizer

          public IRandomizer getRandomizer()

    - #### setRandomizer

          public void setRandomizer(IRandomizer randomizer)

    - #### getUserManager

          public IUserManager getUserManager()

    - #### setUserManager

          public void setUserManager(IUserManager userManager)

    - #### authenticate

          public void authenticate(java.lang.String userID,
                                   char[] password)
                            throws java.lang.SecurityException

      Description copied from interface: `IAuthenticator`
      Authenticates the user with the passed `userID` by checking whether the supplied `password` matches the password stored for this user.

      The implementation is required to throw a `SecurityException` if the passwords do not match.

      Specified by:
        `authenticate` in interface `IAuthenticator`
      Throws:
        `java.lang.SecurityException`

    - #### doBeforeActivate

          protected void doBeforeActivate()
                                   throws java.lang.Exception

      Overrides:
        `doBeforeActivate` in class `Lifecycle`
      Throws:
        `java.lang.Exception`

    - #### doActivate

          protected void doActivate()
                             throws java.lang.Exception

      Overrides:
        `doActivate` in class `Lifecycle`
      Throws:
        `java.lang.Exception`

    - #### createRandomToken

          protected byte[] createRandomToken()

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html