Class CredentialProviderUtils
java.lang.Object
org.apache.drill.exec.store.security.CredentialProviderUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CredentialsProvidergetCredentialsProvider(String clientID, String clientSecret, String tokenURI, String username, String password, String proxyUsername, String proxyPassword, CredentialsProvider credentialsProvider) Constructor for OAuth based authentication.static CredentialsProvidergetCredentialsProvider(String username, String password, CredentialsProvider credentialsProvider) Returns specifiedCredentialsProvider credentialsProviderif it is not null or builds and returnsPlainCredentialsProviderwith specifiedUSERNAMEandPASSWORD.
-
Constructor Details
-
CredentialProviderUtils
public CredentialProviderUtils()
-
-
Method Details
-
getCredentialsProvider
public static CredentialsProvider getCredentialsProvider(String username, String password, CredentialsProvider credentialsProvider) Returns specifiedCredentialsProvider credentialsProviderif it is not null or builds and returnsPlainCredentialsProviderwith specifiedUSERNAMEandPASSWORD. -
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 specifiedCredentialsProvider credentialsProviderif it is not null or builds and returnsPlainCredentialsProviderwith specifiedCLIENT_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 servicespassword- Optional password for proxy or other servicesproxyUsername- 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
-