Class ImpersonatedCredentials.Builder (1.40.0)
public static class ImpersonatedCredentials.Builder extends GoogleCredentials.Builder
Constructors
Builder()
Builder(GoogleCredentials sourceCredentials, String targetPrincipal) (deprecated)
protected Builder(GoogleCredentials sourceCredentials, String targetPrincipal)
Parameters |
Name |
Description |
sourceCredentials |
GoogleCredentials
The source credentials to use for impersonation.
|
targetPrincipal |
String
The service account to impersonate.
|
Builder(ImpersonatedCredentials credentials)
protected Builder(ImpersonatedCredentials credentials)
Methods
build()
public ImpersonatedCredentials build()
Overrides
getCalendar()
public Calendar getCalendar()
getDelegates()
public List<String> getDelegates()
getHttpTransportFactory()
public HttpTransportFactory getHttpTransportFactory()
getLifetime()
Returns |
Type |
Description |
int |
|
getScopes()
public List<String> getScopes()
Returns |
Type |
Description |
List<String> |
List of scopes to be applied to the impersonated token.
|
getSourceCredentials()
public GoogleCredentials getSourceCredentials()
getTargetPrincipal()
public String getTargetPrincipal()
Returns |
Type |
Description |
String |
|
setCalendar(Calendar calendar)
public ImpersonatedCredentials.Builder setCalendar(Calendar calendar)
Parameter |
Name |
Description |
calendar |
Calendar
|
setDelegates(List<String> delegates)
public ImpersonatedCredentials.Builder setDelegates(List<String> delegates)
setHttpTransportFactory(HttpTransportFactory transportFactory)
public ImpersonatedCredentials.Builder setHttpTransportFactory(HttpTransportFactory transportFactory)
setIamEndpointOverride(String iamEndpointOverride)
public ImpersonatedCredentials.Builder setIamEndpointOverride(String iamEndpointOverride)
Parameter |
Name |
Description |
iamEndpointOverride |
String
|
setLifetime(int lifetime)
public ImpersonatedCredentials.Builder setLifetime(int lifetime)
Parameter |
Name |
Description |
lifetime |
int
|
setQuotaProjectId(String quotaProjectId)
public ImpersonatedCredentials.Builder setQuotaProjectId(String quotaProjectId)
Parameter |
Name |
Description |
quotaProjectId |
String
|
Overrides
setScopes(List<String> scopes)
public ImpersonatedCredentials.Builder setScopes(List<String> scopes)
Set the scopes to be applied on the impersonated token and not on the source credential. This
user configuration has precedence over the scopes listed in the source credential json file.
Parameter |
Name |
Description |
scopes |
List<String>
List of scopes to apply to the impersonated token
|
setSourceCredentials(GoogleCredentials sourceCredentials)
public ImpersonatedCredentials.Builder setSourceCredentials(GoogleCredentials sourceCredentials)
setTargetPrincipal(String targetPrincipal)
public ImpersonatedCredentials.Builder setTargetPrincipal(String targetPrincipal)
Parameter |
Name |
Description |
targetPrincipal |
String
|
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 2025-10-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-15 UTC."],[],[]]