public class CredentialFactory extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CLOUD_BIGTABLE_ADMIN_SCOPE
The OAuth scope required to perform administrator actions such as creating tables.
|
static List<String> |
CLOUD_BIGTABLE_ALL_SCOPES
Scopes required for full access to cloud bigtable.
|
static List<String> |
CLOUD_BIGTABLE_READ_WRITE_SCOPES
Scopes required to read and write data from tables.
|
static String |
CLOUD_BIGTABLE_READER_SCOPE
The OAuth scope required to read data from tables.
|
static String |
CLOUD_BIGTABLE_WRITER_SCOPE
The OAuth scope required to write data to tables.
|
Constructor and Description |
---|
CredentialFactory() |
Modifier and Type | Method and Description |
---|---|
static com.google.auth.Credentials |
getApplicationDefaultCredential()
Initializes OAuth2 application default credentials based on the environment the code is running
in.
|
static com.google.auth.Credentials |
getCredentialFromMetadataServiceAccount()
Initializes OAuth2 credential using preconfigured ServiceAccount settings on the local
GCE VM.
|
static com.google.auth.Credentials |
getCredentialFromPrivateKeyServiceAccount(String serviceAccountEmail,
String privateKeyFile)
Initializes OAuth2 credential from a private keyfile, as described in
OAuth2 Service Accounts.
|
static com.google.auth.Credentials |
getCredentialFromPrivateKeyServiceAccount(String serviceAccountEmail,
String privateKeyFile,
List<String> scopes)
Initializes OAuth2 credential from a private keyfile, as described in
OAuth2 Service Accounts.
|
static com.google.auth.Credentials |
getCredentials(CredentialOptions options)
Look up a Credentials object based on a configuration of credentials described in a
CredentialOptions . |
static com.google.api.client.http.HttpTransport |
getHttpTransport()
Returns shared httpTransport instance; initializes httpTransport if it hasn't already been
initialized.
|
static com.google.auth.Credentials |
getInputStreamCredential(InputStream inputStream)
Initializes OAuth2 application default credentials based on an inputStream.
|
public static final String CLOUD_BIGTABLE_ADMIN_SCOPE
public static final String CLOUD_BIGTABLE_READER_SCOPE
public static final String CLOUD_BIGTABLE_WRITER_SCOPE
public static final List<String> CLOUD_BIGTABLE_READ_WRITE_SCOPES
public static com.google.api.client.http.HttpTransport getHttpTransport() throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static com.google.auth.Credentials getCredentials(CredentialOptions options) throws IOException, GeneralSecurityException
CredentialOptions
.IOException
GeneralSecurityException
public static com.google.auth.Credentials getCredentialFromMetadataServiceAccount() throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static com.google.auth.Credentials getCredentialFromPrivateKeyServiceAccount(String serviceAccountEmail, String privateKeyFile) throws IOException, GeneralSecurityException
serviceAccountEmail
- Email address of the service account associated with the keyfile.privateKeyFile
- Full local path to private keyfile.IOException
GeneralSecurityException
public static com.google.auth.Credentials getCredentialFromPrivateKeyServiceAccount(String serviceAccountEmail, String privateKeyFile, List<String> scopes) throws IOException, GeneralSecurityException
serviceAccountEmail
- Email address of the service account associated with the keyfile.privateKeyFile
- Full local path to private keyfile.scopes
- List of well-formed desired scopes to use with the credential.IOException
GeneralSecurityException
public static com.google.auth.Credentials getApplicationDefaultCredential() throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static com.google.auth.Credentials getInputStreamCredential(InputStream inputStream) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
Copyright © 2015. All rights reserved.