public class CredentialOptions extends Object
This class encapsulates the method the Cloud Bigtable client should use to look up
Credentials
. Here are the credential types supported:
Modifier and Type | Class and Description |
---|---|
static class |
CredentialOptions.CredentialType |
static class |
CredentialOptions.JsonCredentialsOptions
A CredentialOption that has a json credentials configured as an InputStream instead of a system
environment property.
|
static class |
CredentialOptions.P12CredentialOptions
A CredentialOptions defined by a serviceAccount and a p12 key file.
|
static class |
CredentialOptions.UserSuppliedCredentialOptions
A CredentialOption that supplies the Credentials directly.
|
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOG |
static String |
SERVICE_ACCOUNT_JSON_ENV_VARIABLE |
Modifier and Type | Method and Description |
---|---|
static CredentialOptions |
credential(com.google.auth.Credentials credentials)
A CredentialOption that wraps an existing
Credentials object. |
static CredentialOptions |
defaultCredentials()
Use the Application Default Credentials which are credentials that identify and authorize the
whole application.
|
CredentialOptions.CredentialType |
getCredentialType() |
static String |
getEnvJsonFile()
Get a configured json credentials file from the GOOGLE_APPLICATION_CREDENTIALS environment
variable.
|
static CredentialOptions |
jsonCredentials(InputStream jsonInputStream) |
static CredentialOptions |
nullCredential()
No credentials - used for unit testing.
|
static CredentialOptions |
p12Credential(String serviceAccount,
String keyFile)
Initializes OAuth2 credential from a private keyfile, as described in OAuth2
Service Accounts
|
public static final String SERVICE_ACCOUNT_JSON_ENV_VARIABLE
protected static final Logger LOG
public static CredentialOptions jsonCredentials(InputStream jsonInputStream)
public static String getEnvJsonFile()
public static CredentialOptions defaultCredentials()
Use the Application Default Credentials which are credentials that identify and authorize the whole application. This is the built-in service account if running on Google Compute Engine. Alternatively, the credentials file from the path in the environment variable GOOGLE_APPLICATION_CREDENTIAL. If GOOGLE_APPLICATION_CREDENTIAL is not set, look at the gcloud/application_default_credentials.json file in the (User)/APPDATA/ directory on Windows or ~/.config/ directory on other OSs .
Initializes OAuth2 credential using preconfigured ServiceAccount settings on the local GCE VM. See: Authenticating from Google Compute Engine.public static CredentialOptions p12Credential(String serviceAccount, String keyFile)
public static CredentialOptions credential(com.google.auth.Credentials credentials)
Credentials
object.public static CredentialOptions nullCredential()
public CredentialOptions.CredentialType getCredentialType()
Copyright © 2015. All rights reserved.