org.apache.ignite.plugin.security

## Class SecurityCredentials

- java.lang.Object
- - org.apache.ignite.plugin.security.SecurityCredentials

- All Implemented Interfaces:
    Externalizable, Serializable

      public class SecurityCredentials
      extends Object
      implements Externalizable

  Security credentials used for node authentication. Security credentials are provided by `SecurityCredentialsProvider` which is specified on node startup in configuration.

  Getting credentials through `SecurityCredentialsProvider` abstraction allows users to provide custom implementations for storing user names and passwords in their environment, possibly in encrypted format. Ignite comes with `SecurityCredentialsBasicProvider` which simply provides the passed in `login` and `password` when encryption or custom logic is not required.

  In addition to `login` and `password`, security credentials allow for specifying `userObject` as well, which can be used to pass in any additional information required for authentication.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SecurityCredentials()` Empty constructor required by `Externalizable`.
    `SecurityCredentials(String login, String password)` Constructs security credentials based on `login` and `password`.
    `SecurityCredentials(String login, String password, @Nullable Object userObj)` Constructs security credentials based on `login`, `password`, and custom user object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `Object` | `getLogin()` Gets login.
    `Object` | `getPassword()` Gets password.
    `@Nullable Object` | `getUserObject()` Gets user-specific object.
    `int` | `hashCode()`
    `void` | `readExternal(ObjectInput in)`
    `void` | `setLogin(Object login)` Sets login.
    `void` | `setPassword(Object password)` Sets password.
    `void` | `setUserObject(@Nullable Object userObj)` Sets user-specific object.
    `String` | `toString()`
    `void` | `writeExternal(ObjectOutput out)`

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

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

- - ### Constructor Detail

    - #### SecurityCredentials

          public SecurityCredentials()

      Empty constructor required by `Externalizable`.

    - #### SecurityCredentials

          public SecurityCredentials(String login,
                                     String password)

      Constructs security credentials based on `login` and `password`.
      Parameters:
        `login` - Login.
        `password` - Password.

    - #### SecurityCredentials

          public SecurityCredentials(String login,
                                     String password,
                                     @Nullable
                                     @Nullable Object userObj)

      Constructs security credentials based on `login`, `password`, and custom user object.
      Parameters:
        `login` - Login.
        `password` - Password.
        `userObj` - User object.

  - ### Method Detail

    - #### getLogin

          public Object getLogin()

      Gets login.
      Returns:
        Login.

    - #### setLogin

          public void setLogin(Object login)

      Sets login.
      Parameters:
        `login` - Login.

    - #### getPassword

          public Object getPassword()

      Gets password.
      Returns:
        Password.

    - #### setPassword

          public void setPassword(Object password)

      Sets password.
      Parameters:
        `password` - Password.

    - #### getUserObject

          @Nullable
          public @Nullable Object getUserObject()

      Gets user-specific object.
      Returns:
        User object.

    - #### setUserObject

          public void setUserObject(@Nullable
                                    @Nullable Object userObj)

      Sets user-specific object.
      Parameters:
        `userObj` - User object.

    - #### writeExternal

          public void writeExternal(ObjectOutput out)
                             throws IOException

      Specified by:
        `writeExternal` in interface `Externalizable`
      Throws:
        `IOException`

    - #### readExternal

          public void readExternal(ObjectInput in)
                            throws IOException,
                                   ClassNotFoundException

      Specified by:
        `readExternal` in interface `Externalizable`
      Throws:
        `IOException`
        `ClassNotFoundException`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020