Package com.cyberark.conjur.api.clients
Class AuthnClient
- java.lang.Object
-
- com.cyberark.conjur.api.clients.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.
-
-
Constructor Summary
Constructors Constructor Description AuthnClient(Credentials credentials, Endpoints endpoints)AuthnClient(Credentials credentials, Endpoints endpoints, SSLContext sslContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tokenauthenticate()Return an authentication token.Tokenauthenticate(boolean useCachedToken)Return an authentication token.Stringlogin()Login to a Conjur account with the credentials specified in the configuration
-
-
-
Constructor Detail
-
AuthnClient
public AuthnClient(Credentials credentials, Endpoints endpoints)
-
AuthnClient
public AuthnClient(Credentials credentials, Endpoints endpoints, SSLContext sslContext)
-
-
Method Detail
-
authenticate
public Token authenticate()
Description copied from interface:AuthnProviderReturn an authentication token. This method should be equivalent toauthenticate(true)if the implementation supports token caching.- Specified by:
authenticatein interfaceAuthnProvider- Returns:
- a Conjur authentication token
-
authenticate
public Token authenticate(boolean useCachedToken)
Description copied from interface:AuthnProviderReturn 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:
authenticatein interfaceAuthnProvider- 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
-
-