Class CredentialProviderUtils
java.lang.Object
org.apache.drill.exec.store.security.CredentialProviderUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CredentialsProvider
getCredentialsProvider
(String clientID, String clientSecret, String tokenURI, String username, String password, String proxyUsername, String proxyPassword, CredentialsProvider credentialsProvider) Constructor for OAuth based authentication.static CredentialsProvider
getCredentialsProvider
(String username, String password, CredentialsProvider credentialsProvider) Returns specifiedCredentialsProvider credentialsProvider
if it is not null or builds and returnsPlainCredentialsProvider
with specifiedUSERNAME
andPASSWORD
.
-
Constructor Details
-
CredentialProviderUtils
public CredentialProviderUtils()
-
-
Method Details
-
getCredentialsProvider
public static CredentialsProvider getCredentialsProvider(String username, String password, CredentialsProvider credentialsProvider) Returns specifiedCredentialsProvider credentialsProvider
if it is not null or builds and returnsPlainCredentialsProvider
with specifiedUSERNAME
andPASSWORD
. -
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 credentialsProvider
if it is not null or builds and returnsPlainCredentialsProvider
with 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
-