You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[AIP-4117] Adding documentation for configurable token lifetime (#938)
Adding documentation for configurable token lifetime for workload identity pools and ADC creation. Also reformatting header types so the table of contents is correct.
Copy file name to clipboardExpand all lines: aip/auth/4117.md
+24-5Lines changed: 24 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,20 @@ $ gcloud iam workload-identity-pools create-cred-config \
74
74
--output-file=$FILEPATH.json
75
75
```
76
76
77
+
If you wish to configure the service account access token lifetime,
78
+
an additional flag `--service-account-token-lifetime-seconds` should be added to the [`gcloud iam workload-identity-pools create-cred-config`](/sdk/gcloud/reference/iam/workload-identity-pools/create-cred-config) command (this example uses an AWS configuration, but the token lifetime can be configured for all workload identity federation providers):
79
+
80
+
```bash
81
+
$ gcloud iam workload-identity-pools create-cred-config \
The service-account-token-lifetime-seconds flag is optional. If not provided, this defaults to one hour. The minimum allowed value is 600 (10 minutes) and the maximum allowed value is 43200 (12 hours). If a lifetime greater than one hour is required, the service account must be added as an allowed value in an Organization Policy that enforces the `constraints/iam.allowServiceAccountCredentialLifetimeExtension` constraint.
90
+
77
91
The external identities configuration file can be used with
78
92
[Application Default Credentials][6]. In order to use external identities with
79
93
Application Default Credentials, the full path to this file should be stored
The auth libraries should use the information in the JSON configuration file to
125
139
retrieve the external credentials and exchange them for Google access tokens
@@ -136,6 +150,7 @@ All external account JSON files must share the following fields:
136
150
| audience | Yes | This is the STS audience which contains the resource name for the workload identity pool and the provider identifier in that pool. |
137
151
| subject_token_type | Yes | This is the STS subject token type based on the [OAuth 2.0 token exchange spec][7]. |
138
152
| service_account_impersonation_url | No | This is the URL for the service account impersonation request. If this is not available, the STS returned access token should be directly used without impersonation. |
153
+
| service_account_impersonation.*| No | This object defines additional service account impersonation options. Only one field is currently supported: “token_lifetime_seconds": This is the requested access token lifetime, e.g. `2800`. |
139
154
| token_url | Yes | This is the STS token exchange endpoint. |
140
155
| credential_source.*| Yes | This object defines the mechanism used to retrieve the external credential from the local environment so that it can be exchanged for a GCP access token via the STS endpoint. |
141
156
@@ -176,8 +191,11 @@ types of external account credentials:
176
191
`https://www.googleapis.com/auth/cloud-platform` or IAM scope
177
192
`https://www.googleapis.com/auth/iam`) are required in the underlying
178
193
access token.
194
+
- The service account access token lifetime also needs to be provided for this endpoint. The value in
195
+
**service_account_impersonation.token_lifetime_seconds** will be used if it
196
+
was provided, otherwise it will default to 1 hour.
179
197
180
-
####Determining the subject token in AWS
198
+
### Determining the subject token in AWS
181
199
182
200
External account configuration JSON files should contain the following
183
201
information in the `credential_source` object to facilitate retrieval of AWS
@@ -274,7 +292,7 @@ The auth libraries and applications **must** follow the steps below:
274
292
```
275
293
For the AWS token, STS requires a special header `x-goog-cloud-endpoint` to recognize that the token is for a specific workload identity provider.
276
294
277
-
####Determining the subject token in Microsoft Azure and URL-sourced credentials
295
+
### Determining the subject token in Microsoft Azure and URL-sourced credentials
278
296
279
297
External account configuration JSON files should contain the following
280
298
information in the `credential_source` object to facilitate retrieval of Azure
@@ -347,7 +365,7 @@ The auth libraries and applications **must** follow the steps below:
347
365
- Parse the file as JSON and then retrieve the external credential from
348
366
the field name based on the value of **subject_token_field_name**.
349
367
350
-
####Determining the subject token in file-sourced credentials
368
+
### Determining the subject token in file-sourced credentials
351
369
352
370
External account configuration JSON files contain the following information
353
371
in the `credential_source` object to facilitate retrieval of file-sourced
@@ -391,7 +409,7 @@ The auth libraries and applications **must** follow the steps below:
391
409
the field name based on the value of **subject_token_field_name**.
392
410
393
411
394
-
####Determining the subject token in executable-sourced credentials
412
+
### Determining the subject token in executable-sourced credentials
395
413
396
414
External account configuration JSON files contain the following information
397
415
in the `credential_source` object to facilitate retrieval of executable-sourced
@@ -512,6 +530,7 @@ The auth libraries and applications **must** follow the steps below:
512
530
513
531
-**2021-12-10**: Add AIP for External Account Credentials (AIP 4117).
0 commit comments