Reference documentation and code samples for the Google Cloud Iam Credentials V1 Client class GenerateIdTokenRequest.
Generated from protobuf message google.iam.credentials.v1.GenerateIdTokenRequest
Namespace
Google \ Cloud \ Iam \ Credentials \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Required. The resource name of the service account for which the credentials are requested, in the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid.
↳ delegates
array
The sequence of service accounts in a delegation chain. Each service account must be granted the roles/iam.serviceAccountTokenCreator role on its next service account in the chain. The last service account in the chain must be granted the roles/iam.serviceAccountTokenCreator role on the service account that is specified in the name field of the request. The delegates must have the following format: projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard character is required; replacing it with a project ID is invalid.
↳ audience
string
Required. The audience for the token, such as the API or account that this token grants access to.
↳ include_email
bool
Include the service account email in the token. If set to true, the token will contain email and email_verified claims.
getName
Required. The resource name of the service account for which the credentials
are requested, in the following format:
projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard
character is required; replacing it with a project ID is invalid.
Returns
Type
Description
string
setName
Required. The resource name of the service account for which the credentials
are requested, in the following format:
projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard
character is required; replacing it with a project ID is invalid.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDelegates
The sequence of service accounts in a delegation chain. Each service
account must be granted the roles/iam.serviceAccountTokenCreator role
on its next service account in the chain. The last service account in the
chain must be granted the roles/iam.serviceAccountTokenCreator role
on the service account that is specified in the name field of the
request.
The delegates must have the following format:
projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard
character is required; replacing it with a project ID is invalid.
The sequence of service accounts in a delegation chain. Each service
account must be granted the roles/iam.serviceAccountTokenCreator role
on its next service account in the chain. The last service account in the
chain must be granted the roles/iam.serviceAccountTokenCreator role
on the service account that is specified in the name field of the
request.
The delegates must have the following format:
projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard
character is required; replacing it with a project ID is invalid.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getAudience
Required. The audience for the token, such as the API or account that this token
grants access to.
Returns
Type
Description
string
setAudience
Required. The audience for the token, such as the API or account that this token
grants access to.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getIncludeEmail
Include the service account email in the token. If set to true, the
token will contain email and email_verified claims.
Returns
Type
Description
bool
setIncludeEmail
Include the service account email in the token. If set to true, the
token will contain email and email_verified claims.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
static::build
Parameters
Name
Description
name
string
Required. The resource name of the service account for which the credentials
are requested, in the following format:
projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard
character is required; replacing it with a project ID is invalid. Please see
IAMCredentialsClient::serviceAccountName() for help formatting this field.
delegates
string[]
The sequence of service accounts in a delegation chain. Each service
account must be granted the roles/iam.serviceAccountTokenCreator role
on its next service account in the chain. The last service account in the
chain must be granted the roles/iam.serviceAccountTokenCreator role
on the service account that is specified in the name field of the
request.
The delegates must have the following format:
projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}. The - wildcard
character is required; replacing it with a project ID is invalid.
audience
string
Required. The audience for the token, such as the API or account that this token
grants access to.
includeEmail
bool
Include the service account email in the token. If set to true, the
token will contain email and email_verified claims.
[[["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-09-04 UTC."],[],[],null,["# Google Cloud Iam Credentials V1 Client - Class GenerateIdTokenRequest (2.0.4)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.4 (latest)](/php/docs/reference/cloud-iam-credentials/latest/V1.GenerateIdTokenRequest)\n- [2.0.3](/php/docs/reference/cloud-iam-credentials/2.0.3/V1.GenerateIdTokenRequest)\n- [1.2.5](/php/docs/reference/cloud-iam-credentials/1.2.5/V1.GenerateIdTokenRequest)\n- [1.1.2](/php/docs/reference/cloud-iam-credentials/1.1.2/V1.GenerateIdTokenRequest)\n- [1.0.6](/php/docs/reference/cloud-iam-credentials/1.0.6/V1.GenerateIdTokenRequest) \nReference documentation and code samples for the Google Cloud Iam Credentials V1 Client class GenerateIdTokenRequest.\n\nGenerated from protobuf message `google.iam.credentials.v1.GenerateIdTokenRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Iam \\\\ Credentials \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nRequired. The resource name of the service account for which the credentials\nare requested, in the following format:\n`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard\ncharacter is required; replacing it with a project ID is invalid.\n\n### setName\n\nRequired. The resource name of the service account for which the credentials\nare requested, in the following format:\n`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard\ncharacter is required; replacing it with a project ID is invalid.\n\n### getDelegates\n\nThe sequence of service accounts in a delegation chain. Each service\naccount must be granted the `roles/iam.serviceAccountTokenCreator` role\non its next service account in the chain. The last service account in the\nchain must be granted the `roles/iam.serviceAccountTokenCreator` role\non the service account that is specified in the `name` field of the\nrequest.\n\nThe delegates must have the following format:\n`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard\ncharacter is required; replacing it with a project ID is invalid.\n\n### setDelegates\n\nThe sequence of service accounts in a delegation chain. Each service\naccount must be granted the `roles/iam.serviceAccountTokenCreator` role\non its next service account in the chain. The last service account in the\nchain must be granted the `roles/iam.serviceAccountTokenCreator` role\non the service account that is specified in the `name` field of the\nrequest.\n\nThe delegates must have the following format:\n`projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard\ncharacter is required; replacing it with a project ID is invalid.\n\n### getAudience\n\nRequired. The audience for the token, such as the API or account that this token\ngrants access to.\n\n### setAudience\n\nRequired. The audience for the token, such as the API or account that this token\ngrants access to.\n\n### getIncludeEmail\n\nInclude the service account email in the token. If set to `true`, the\ntoken will contain `email` and `email_verified` claims.\n\n### setIncludeEmail\n\nInclude the service account email in the token. If set to `true`, the\ntoken will contain `email` and `email_verified` claims.\n\n### static::build"]]