org.apache.geode.security.generator

## Class UserPasswordWithExtraPropsAuthInit

- java.lang.Object
- - org.apache.geode.security.templates.UserPasswordAuthInit
  - - org.apache.geode.security.generator.UserPasswordWithExtraPropsAuthInit

- All Implemented Interfaces:
    CacheCallback, Declarable, AuthInitialize

      public class UserPasswordWithExtraPropsAuthInit
      extends UserPasswordAuthInit

  An `AuthInitialize` implementation that obtains the user name and password as the credentials from the given set of properties. If keep-extra-props property exits, it will copy rest of the properties provided in getCredential props argument will also be copied as new credentials.
  Since:
    GemFire 5.5

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `EXTRA_PROPS`
    `static java.lang.String` | `SECURITY_PREFIX`

    - ### Fields inherited from class org.apache.geode.security.templates.UserPasswordAuthInit

      `PASSWORD, securityLogWriter, systemLogWriter, USER_NAME`

    - ### Fields inherited from interface org.apache.geode.security.AuthInitialize

      `SECURITY_PASSWORD, SECURITY_USERNAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserPasswordWithExtraPropsAuthInit()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static AuthInitialize` | `create()`
    `java.util.Properties` | `getCredentials(java.util.Properties securityProperties, DistributedMember server, boolean isPeer)` Initialize with the given set of security properties and return the credentials for the peer/client as properties.

    - ### Methods inherited from class org.apache.geode.security.templates.UserPasswordAuthInit

      `close, init`

    - ### 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.AuthInitialize

      `getCredentials, init`

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

      `init, initialize`

- - ### Field Detail

    - #### SECURITY_PREFIX

          public static final java.lang.String SECURITY_PREFIX

      See Also:
        Constant Field Values

    - #### EXTRA_PROPS

          public static final java.lang.String EXTRA_PROPS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### UserPasswordWithExtraPropsAuthInit

          public UserPasswordWithExtraPropsAuthInit()

  - ### Method Detail

    - #### create

          public static AuthInitialize create()

    - #### getCredentials

          public java.util.Properties getCredentials(java.util.Properties securityProperties,
                                                     DistributedMember server,
                                                     boolean isPeer)
                                              throws AuthenticationFailedException

      Description copied from interface: `AuthInitialize`
      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.
      Specified by:
        `getCredentials` in interface `AuthInitialize`
      Overrides:
        `getCredentials` in class `UserPasswordAuthInit`
      Parameters:
        `securityProperties` - 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` It needs to contain "security-username" and "security-password" When using Integrated security, all members, peer/client will use the same credentials. but we still need to use these params to support the old authenticator
      Throws:
        `AuthenticationFailedException` - in case of failure to obtain the credentials