DummyAuthenticator (Apache Geode 1.7.0)
Date: 2018-09-27

org.apache.geode.security.templates

## Class DummyAuthenticator

- java.lang.Object
- - org.apache.geode.security.templates.DummyAuthenticator

- All Implemented Interfaces:
    CacheCallback, Declarable, Authenticator

      public class DummyAuthenticator
      extends java.lang.Object
      implements Authenticator

  A dummy implementation of the `Authenticator` interface that expects a user name and password allowing authentication depending on the format of the user name.
  Since:
    GemFire 5.5

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DummyAuthenticator()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.security.Principal` | `authenticate(java.util.Properties credentials, DistributedMember member)` Verify the credentials provided in the properties for the client/peer as specified in member ID and returns the principal associated with the client/peer.
    `static boolean` | `checkValidName(java.lang.String userName)`
    `void` | `close()` Called when the region containing this callback is closed or destroyed, when the cache is closed, or when a callback is removed from a region using an `AttributesMutator`.
    `static Authenticator` | `create()`
    `void` | `init(java.util.Properties securityProperties, LogWriter systemLogWriter, LogWriter securityLogWriter)` Initialize the callback for a client/peer.

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

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

    - ### Methods inherited from interface org.apache.geode.security.Authenticator

      `authenticate, init`

    - ### Methods inherited from interface org.apache.geode.cache.Declarable

      `initialize`

- - ### Constructor Detail

    - #### DummyAuthenticator

          public DummyAuthenticator()

  - ### Method Detail

    - #### create

          public static Authenticator create()

    - #### checkValidName

          public static boolean checkValidName(java.lang.String userName)

    - #### init

          public void init(java.util.Properties securityProperties,
                           LogWriter systemLogWriter,
                           LogWriter securityLogWriter)
                    throws AuthenticationFailedException

      Description copied from interface: `Authenticator`
      Initialize the callback for a client/peer. This is invoked when a new connection from a client/peer is created with the host.
      Specified by:
        `init` in interface `Authenticator`
      Parameters:
        `securityProperties` - the security properties obtained using a call to `DistributedSystem.getSecurityProperties()`
        `systemLogWriter` - `LogWriter` for system logs
        `securityLogWriter` - `LogWriter` for security logs
      Throws:
        `AuthenticationFailedException` - if some exception occurs during the initialization

    - #### authenticate

          public java.security.Principal authenticate(java.util.Properties credentials,
                                                      DistributedMember member)
                                               throws AuthenticationFailedException

      Description copied from interface: `Authenticator`
      Verify the credentials provided in the properties for the client/peer as specified in member ID and returns the principal associated with the client/peer.
      Specified by:
        `authenticate` in interface `Authenticator`
      Parameters:
        `credentials` - the credentials of the client/peer as a set of property key/values
        `member` - the `DistributedMember` object of the connecting client/peer member. NULL when invoked locally on the member initiating the authentication request.
      Returns:
        the principal for the client/peer when authentication succeeded
      Throws:
        `AuthenticationFailedException` - If the authentication of the client/peer fails.

    - #### close

          public void close()

      Description copied from interface: `CacheCallback`
      Called when the region containing this callback is closed or destroyed, when the cache is closed, or when a callback is removed from a region using an `AttributesMutator`.

      Implementations should cleanup any external resources such as database connections. Any runtime exceptions this method throws will be logged.

      It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.

      Specified by:
        `close` in interface `CacheCallback`
      See Also:
        `RegionService.close()`, `Region.close()`, `Region.localDestroyRegion()`, `Region.destroyRegion()`, `AttributesMutator`