Class Credentials


  • public class Credentials
    extends Object
    Stores credentials for a Conjur identity.

    A Conjur identity consists of a username and a password. The password may either be a user's password or the api key of a user or host. These cases are treated identically by the Conjur authentication service.

    Credentials supports hashCode and equals and can be used as keys, for example for caching.

    • Constructor Detail

      • Credentials

        public Credentials​(String username,
                           String password)
        Parameters:
        username - the username/login for this Conjur identity
        password - the password or api key for this Conjur identity
      • Credentials

        public Credentials​(String username,
                           String password,
                           String authnUrl)
        Parameters:
        username - the username/login for this Conjur identity
        password - the password or api key for this Conjur identity
        authnUrl - the conjur authentication url
    • Method Detail

      • fromSystemProperties

        public static Credentials fromSystemProperties()
        Creates a Credentials instance from the system properties
        Returns:
        the credentials stored in the system property.
      • getUsername

        public String getUsername()
        Returns:
        the username/login for this Conjur identity
      • getPassword

        public String getPassword()
        Returns:
        the api key or password for this Conjur identity
      • getAuthnUrl

        public String getAuthnUrl()
        Returns:
        the service id of this Conjur identity
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object