Class CdpCredentialsProviderChain

java.lang.Object
com.cloudera.cdp.authentication.credentials.CdpCredentialsProviderChain
All Implemented Interfaces:
CdpCredentialsProvider
Direct Known Subclasses:
DefaultCdpCredentialProviderChain

public class CdpCredentialsProviderChain extends Object implements CdpCredentialsProvider
CdpCredentialsProvider that chains together multiple credentials providers. When a caller first requests credentials from this provider, it calls all the providers in the chain, in the original order specified, until one can provide credentials, and then returns those credentials. If all of the credential providers in the chain have been called, and none of them can provide credentials, then this class will throw an exception indicated that no credentials are available.
  • Constructor Details

    • CdpCredentialsProviderChain

      public CdpCredentialsProviderChain(CdpCredentialsProvider... credentialProviders)
      Constructor.
      Parameters:
      credentialProviders - the credential providers
  • Method Details

    • getCredentials

      public CdpCredentials getCredentials()
      Description copied from interface: CdpCredentialsProvider
      Returns CdpCredentials which the caller can use to authenticate a CDP request. Each implementation of CdpCredentialsProvider can chose its own strategy for loading credentials. For example, an implementation might load credentials from an existing key management system, or load new credentials when credentials are rotated.
      Specified by:
      getCredentials in interface CdpCredentialsProvider
      Returns:
      CdpCredentials which the caller can use to authenticate an CDP request.