private CredentialProvider getCredentialProvider() {
    CredentialProvider provider = null;

    List<CredentialProvider> providers;
    try {
      providers = CredentialProviderFactory.getProviders(getConf());
      provider = providers.get(0);
    } catch (IOException e) {
      e.printStackTrace(System.err);
    }

    return provider;
  }
Gets the provider object for the user specified provider.

@return - A credential provider.
ambari-server/src/main/java/org/apache/ambari/server/credentialapi/CredentialUtil.java