public class GdchCredentials extends GoogleCredentials
| Modifier and Type | Class and Description |
|---|---|
static class |
GdchCredentials.Builder |
OAuth2Credentials.CredentialsChangedListenerquotaProjectIdGOOGLE_DEFAULT_UNIVERSE| Modifier and Type | Method and Description |
|---|---|
GdchCredentials |
createWithGdchAudience(URI apiAudience)
Create a copy of GDCH credentials with the specified audience.
|
boolean |
equals(Object obj) |
static GdchCredentials |
fromStream(InputStream credentialsStream)
Returns credentials defined by a GdchCredentials key file in JSON format from the Google
Developers Console.
|
static GdchCredentials |
fromStream(InputStream credentialsStream,
HttpTransportFactory transportFactory)
Returns credentials defined by a GdchCredentials key file in JSON format from the Google
Developers Console.
|
URI |
getApiAudience() |
String |
getCaCertPath() |
PrivateKey |
getPrivateKey() |
String |
getPrivateKeyId() |
String |
getProjectId()
The projectId value for a Credential type.
|
String |
getServiceIdentityName() |
URI |
getTokenServerUri() |
HttpTransportFactory |
getTransportFactory() |
int |
hashCode() |
static GdchCredentials.Builder |
newBuilder() |
AccessToken |
refreshAccessToken()
Refresh the OAuth2 access token by getting a new access token using a JSON Web Token (JWT).
|
GdchCredentials.Builder |
toBuilder() |
String |
toString() |
create, create, createDelegated, createScoped, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getCredentialInfo, getQuotaProjectId, getUniverseDomain, isExplicitUniverseDomain, toStringHelperaddChangeListener, getAccessToken, getAuthenticationType, getFromServiceLoader, getRequestMetadata, getRequestMetadata, getRequestMetadataInternal, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListenerblockingGetToCallback, getMetricsCredentialType, getRequestMetadatapublic static GdchCredentials fromStream(InputStream credentialsStream) throws IOException
Important: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud Platform, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information, refer to documentation.
credentialsStream - the stream with the credential definition.IOException - if the credential cannot be created from the stream.public static GdchCredentials fromStream(InputStream credentialsStream, HttpTransportFactory transportFactory) throws IOException
Important: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud Platform, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information, refer to documentation.
credentialsStream - the stream with the credential definition.transportFactory - HTTP transport factory, creates the transport used to get access
tokens.IOException - if the credential cannot be created from the stream.public GdchCredentials createWithGdchAudience(URI apiAudience) throws IOException
apiAudience - The intended audience for GDCH credentials.IOExceptionpublic AccessToken refreshAccessToken() throws IOException
For GDCH credentials, this class creates a self-signed JWT, and sends to the GDCH authentication endpoint (tokenServerUri) to exchange an access token for the intended api audience (apiAudience).
refreshAccessToken in class OAuth2CredentialsIOExceptionpublic final String getProjectId()
GoogleCredentialsgetProjectId in class GoogleCredentialspublic final String getPrivateKeyId()
public final PrivateKey getPrivateKey()
public final String getServiceIdentityName()
public final URI getTokenServerUri()
public final URI getApiAudience()
public final HttpTransportFactory getTransportFactory()
public final String getCaCertPath()
public static GdchCredentials.Builder newBuilder()
public GdchCredentials.Builder toBuilder()
toBuilder in class GoogleCredentialspublic int hashCode()
hashCode in class GoogleCredentialspublic String toString()
toString in class GoogleCredentialspublic boolean equals(Object obj)
equals in class GoogleCredentialsCopyright © 2026 Google. All rights reserved.