Class AuthnClient

  • All Implemented Interfaces:
    AuthnProvider

    public class AuthnClient
    extends Object
    implements AuthnProvider
    Conjur authentication service client. This client provides methods to get API tokens from the conjur authentication service, which can then be used to make authenticated calls to other conjur services.
    • Method Detail

      • authenticate

        public Token authenticate()
        Description copied from interface: AuthnProvider
        Return an authentication token. This method should be equivalent to authenticate(true) if the implementation supports token caching.
        Specified by:
        authenticate in interface AuthnProvider
        Returns:
        a Conjur authentication token
      • authenticate

        public Token authenticate​(boolean useCachedToken)
        Description copied from interface: AuthnProvider
        Return an authentication token. If the implementation supports token caching and useCachedToken is true, it should return a cached token if a valid (non-expired) one is available. If useCachedToken is false, it should always fetch a fresh token from the Conjur authn service.
        Specified by:
        authenticate in interface AuthnProvider
        Parameters:
        useCachedToken - whether to use a cached token.
        Returns:
        a Conjur authentication token
      • login

        public String login()
        Login to a Conjur account with the credentials specified in the configuration
        Returns:
        The API key of the user