org.apache.geode.security

## Interface AuthInitialize

- All Superinterfaces:
    CacheCallback, Declarable

      public interface AuthInitialize
      extends CacheCallback

  Specifies the mechanism to obtain credentials for a client or peer. It is mandatory for clients and peers when running in secure mode and an `Authenticator` has been configured on the server/locator side respectively. Implementations should register name of the static creation function (that returns an object of the class) as the security-peer-auth-init system property on peers and as the security-client-auth-init system property on clients.
  Since:
    GemFire 5.5

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `default java.util.Properties` | `getCredentials(java.util.Properties securityProps)` Implement this since Geode1.0
    `java.util.Properties` | `getCredentials(java.util.Properties securityProps, DistributedMember server, boolean isPeer)` Deprecated. since Geode 1.0, use getCredentials(Properties). When using Integrated security, all members, peer/client will use the same credentials.
    `default void` | `init()`
    `void` | `init(LogWriter systemLogger, LogWriter securityLogger)` Deprecated. since Geode 1.0, use init()

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

      `close`

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

      `init`

- - ### Method Detail

    - #### init

          @Deprecated
          void init(LogWriter systemLogger,
                                LogWriter securityLogger)
                         throws AuthenticationFailedException

      Deprecated. since Geode 1.0, use init()
      Initialize the callback for a client/peer. This is invoked when a new connection from a client/peer is created with the host.
      Parameters:
        `systemLogger` - `LogWriter` for system logs
        `securityLogger` - `LogWriter` for security logs
      Throws:
        `AuthenticationFailedException` - if some exception occurs during the initialization

    - #### init

          default void init()

      Since:
        Geode 1.0. implement this method instead of init with logwriters. Implementation should use log4j instead of these loggers.

    - #### getCredentials

          @Deprecated
          java.util.Properties getCredentials(java.util.Properties securityProps,
                                                          DistributedMember server,
                                                          boolean isPeer)
                                                   throws AuthenticationFailedException

      Deprecated. since Geode 1.0, use getCredentials(Properties). When using Integrated security, all members, peer/client will use the same credentials.
      Initialize with the given set of security properties and return the credentials for the peer/client as properties. This method can modify the given set of properties. For example it may invoke external agents or even interact with the user. Normally it is expected that implementations will filter out security-* properties that are needed for credentials and return only those.
      Parameters:
        `securityProps` - the security properties obtained using a call to `DistributedSystem.getSecurityProperties()` that will be used for obtaining the credentials
        `server` - the `DistributedMember` object of the server/group-coordinator to which connection is being attempted
        `isPeer` - true when this is invoked for peer initialization and false when invoked for client initialization
      Returns:
        the credentials to be used for the given `server`
      Throws:
        `AuthenticationFailedException` - in case of failure to obtain the credentials

    - #### getCredentials

          default java.util.Properties getCredentials(java.util.Properties securityProps)

      Implement this since Geode1.0
      Parameters:
        `securityProps` -
      Returns:
        the credentials to be used. It needs to contain "security-username" and "security-password"