java.lang.Object
org.sonatype.gradle.plugins.scan.nexus.iq.client.common.Authentication
All Implemented Interfaces:
Serializable

public class Authentication extends Object implements Serializable
This class is an abstraction of authentication credentials. Internally passwords are stored as char[] to avoid logging any sensitive information as well as allowing the objects to be garbage collected properly.
See Also:
  • Constructor Details

    • Authentication

      public Authentication(String username, char[] password)
      Both username and password are required.
      Parameters:
      username - the username.
      password - the password.
      Throws:
      NullPointerException - if either username or password not provided.
    • Authentication

      public Authentication(String username, String password)
      Both username and password are required.
      Parameters:
      username - the username.
      password - the password.
      Throws:
      NullPointerException - if either username or password not provided.
  • Method Details

    • getUsername

      public String getUsername()
      Returns:
      the username.
    • getPassword

      public char[] getPassword()
      Returns:
      the password.