Class ServiceAccountCredentials.Builder (1.54.0)
1.54.0 (latest)
1.50.0
1.49.0
1.48.0
1.46.0
1.43.0
1.42.1
1.41.0
1.40.0
1.39.1
1.38.0
1.37.1
1.36.0
1.35.0
1.34.0
1.33.1
1.32.1
1.31.0
1.30.1
1.29.1-SNAPSHOT
1.28.0
1.27.0
1.26.0
1.25.0
1.24.1
1.20.0
1.19.0
1.18.0
1.7.0
1.6.1
1.4.0
1.3.0
public static class ServiceAccountCredentials . Builder extends GoogleCredentials . Builder
Constructors
Builder()
Builder(ServiceAccountCredentials credentials)
protected Builder ( ServiceAccountCredentials credentials )
Methods
build()
public ServiceAccountCredentials build ()
Overrides
getClientEmail()
public @Nullable String getClientEmail ()
Returns
Type
Description
@org.jspecify.annotations.Nullable java.lang.String
getClientId()
public @Nullable String getClientId ()
Returns
Type
Description
@org.jspecify.annotations.Nullable java.lang.String
getDefaultScopes()
public @Nullable Collection<String> getDefaultScopes ()
Returns
Type
Description
@org.jspecify.annotations.Nullable java.util.Collection <String >
getHttpTransportFactory()
public @Nullable HttpTransportFactory getHttpTransportFactory ()
Returns
Type
Description
@org.jspecify.annotations.Nullable com.google.auth.http.HttpTransportFactory
getLifetime()
Returns
Type
Description
int
getPrivateKey()
public @Nullable PrivateKey getPrivateKey ()
Returns
Type
Description
@org.jspecify.annotations.Nullable java.security.PrivateKey
getPrivateKeyId()
public @Nullable String getPrivateKeyId ()
Returns
Type
Description
@org.jspecify.annotations.Nullable java.lang.String
getProjectId()
public @Nullable String getProjectId ()
Returns
Type
Description
@org.jspecify.annotations.Nullable java.lang.String
getScopes()
public @Nullable Collection<String> getScopes ()
Returns
Type
Description
@org.jspecify.annotations.Nullable java.util.Collection <String >
getServiceAccountUser()
public @Nullable String getServiceAccountUser ()
Returns
Type
Description
@org.jspecify.annotations.Nullable java.lang.String
getTokenServerUri()
public @Nullable URI getTokenServerUri ()
Returns
Type
Description
@org.jspecify.annotations.Nullable java.net.URI
getUseJwtAccessWithScope()
public boolean getUseJwtAccessWithScope ()
isDefaultRetriesEnabled()
public boolean isDefaultRetriesEnabled ()
setClientEmail(String clientEmail)
public ServiceAccountCredentials . Builder setClientEmail ( String clientEmail )
Parameter
Name
Description
clientEmail
String
setClientId(String clientId)
public ServiceAccountCredentials . Builder setClientId ( String clientId )
Parameter
Name
Description
clientId
String
setDefaultRetriesEnabled(boolean defaultRetriesEnabled)
public ServiceAccountCredentials . Builder setDefaultRetriesEnabled ( boolean defaultRetriesEnabled )
Parameter
Name
Description
defaultRetriesEnabled
boolean
setHttpTransportFactory(HttpTransportFactory transportFactory)
public ServiceAccountCredentials . Builder setHttpTransportFactory ( HttpTransportFactory transportFactory )
setLifetime(int lifetime)
public ServiceAccountCredentials . Builder setLifetime ( int lifetime )
Parameter
Name
Description
lifetime
int
setPrivateKey(PrivateKey privateKey)
public ServiceAccountCredentials . Builder setPrivateKey ( PrivateKey privateKey )
setPrivateKeyId(String privateKeyId)
public ServiceAccountCredentials . Builder setPrivateKeyId ( String privateKeyId )
Parameter
Name
Description
privateKeyId
String
setPrivateKeyString(String privateKeyPkcs8)
public ServiceAccountCredentials . Builder setPrivateKeyString ( String privateKeyPkcs8 )
Parameter
Name
Description
privateKeyPkcs8
String
setProjectId(String projectId)
public ServiceAccountCredentials . Builder setProjectId ( String projectId )
Parameter
Name
Description
projectId
String
setQuotaProjectId(@Nullable String quotaProjectId)
public ServiceAccountCredentials . Builder setQuotaProjectId ( @Nullable String quotaProjectId )
Parameter
Name
Description
quotaProjectId
@org.jspecify.annotations.Nullable java.lang.String
Overrides
setScopes(Collection<String> scopes)
public ServiceAccountCredentials . Builder setScopes ( Collection<String> scopes )
setScopes(Collection<String> scopes, Collection<String> defaultScopes)
public ServiceAccountCredentials . Builder setScopes ( Collection<String> scopes , Collection<String> defaultScopes )
setServiceAccountUser(String serviceAccountUser)
public ServiceAccountCredentials . Builder setServiceAccountUser ( String serviceAccountUser )
Parameter
Name
Description
serviceAccountUser
String
setTokenServerUri(@Nullable URI tokenServerUri)
public ServiceAccountCredentials . Builder setTokenServerUri ( @Nullable URI tokenServerUri )
Parameter
Name
Description
tokenServerUri
@org.jspecify.annotations.Nullable java.net.URI
setUniverseDomain(String universeDomain)
public ServiceAccountCredentials . Builder setUniverseDomain ( String universeDomain )
Parameter
Name
Description
universeDomain
String
Overrides
setUseJwtAccessWithScope(boolean useJwtAccessWithScope)
public ServiceAccountCredentials . Builder setUseJwtAccessWithScope ( boolean useJwtAccessWithScope )
Parameter
Name
Description
useJwtAccessWithScope
boolean
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-10-05 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-10-05 UTC."],[],[]]