Class CredentialProviderUtils

java.lang.Object
org.apache.drill.exec.store.security.CredentialProviderUtils

public class CredentialProviderUtils extends Object
  • Constructor Details

    • CredentialProviderUtils

      public CredentialProviderUtils()
  • Method Details

    • getCredentialsProvider

      public static CredentialsProvider getCredentialsProvider(String username, String password, CredentialsProvider credentialsProvider)
      Returns specified CredentialsProvider credentialsProvider if it is not null or builds and returns PlainCredentialsProvider with specified USERNAME and PASSWORD.
    • getCredentialsProvider

      public static CredentialsProvider getCredentialsProvider(String clientID, String clientSecret, String tokenURI, String username, String password, String proxyUsername, String proxyPassword, CredentialsProvider credentialsProvider)
      Constructor for OAuth based authentication. Allows for tokens to be stored in whatever vault mechanism the user chooses. Returns specified CredentialsProvider credentialsProvider if it is not null or builds and returns PlainCredentialsProvider with specified CLIENT_ID, CLIENT_SECRET, ACCESS_TOKEN, REFRESH_TOKEN.
      Parameters:
      clientID - The OAuth Client ID. This is provided by the application during signup.
      clientSecret - The OAUth Client Secret. This is provided by the application during signup.
      tokenURI - The URI from which you swap the auth code for access and refresh tokens.
      username - Optional username for other services
      password - Optional password for proxy or other services
      proxyUsername - Optional username for a proxy server.
      proxyPassword - Optional password for a proxy server.
      credentialsProvider - The credential store which retains the credentials.
      Returns:
      A credential provider with the access tokens