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
| executable | Yes | Holds the information necessary to run the executable. |
388
+
| executable.command | Yes | Specifies the full command to run to retrieve the subject token. This can include arguments. Must be an absolute path for the program. |
389
+
| executable.timeout_millis | No | Specifies the timeout duration, in milliseconds. Defaults to 30 seconds when not provided. |
390
+
| executable.output_file | No | Specifies the absolute path to the output file where the executable will cache the response. By specifying this path, the auth libraries will first check this location before running the executable. The format of the file should match the JSON format expected by the auth libraries defined below. |
391
+
392
+
The JSON file for executable-sourced configuration files (OIDC / SAML) should have
| version | number | The version of the JSON output. Currently only version 1 is supported. |
421
+
| success | boolean | The status of the response. True in this case. |
422
+
| token_type | string | The 3rd party subject token type. Must be *urn:ietf:params:oauth:token-type:jwt*, *urn:ietf:params:oauth:token-type:id_token*, or *urn:ietf:params:oauth:token-type:saml2*. |
423
+
| id_token OR saml_response | string | The 3rd party OIDC token or SAML response. |
424
+
| expiration_time | number | The 3rd party subject token expiration time in seconds (unix epoch time). |
| version | number | The version of the JSON output. Currently only version 1 is supported. |
453
+
| success | boolean | The status of the response. False in this case. ||
454
+
| code | string | The error code. |
455
+
| message | string | The error message. |
456
+
457
+
A sample executable error response:
458
+
```json
459
+
{
460
+
"version": 1,
461
+
"success": false,
462
+
"code": "401",
463
+
"message": "Caller not authorized."
464
+
}
465
+
```
466
+
467
+
The auth libraries and applications **must** follow the steps below:
468
+
469
+
- Check **credential_source** has an **executable** field and no **environment_id**. If not,
470
+
this is not a executable-sourced credential and the proceeding steps do not apply.
471
+
- Retrieve the external credential's executable information from the
472
+
**credential_source.executable** field.
473
+
- Check that the `GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES` environment variable is set to **1**. If not, error out.
474
+
- Before the next step, check if **credential_source.executable.output_file** was specified in the credential configuration.
475
+
- If present, check if there is an executable response at that location.
476
+
- If the response is valid and unexpired, or there is no response at that location, continue execution.
477
+
- If the response is malformed or invalid, error out.
478
+
- Ensure the following environment variables will be available to the executable:
479
+
-`GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE`: The audience field from the credential configuration. Must always be present.
480
+
-`GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL`: The service account email. Only present when service account impersonation is used.
481
+
-`GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE`: The output file location from the credential configuration. Only present when specified in the credential configuration.
482
+
- Run the command specified at **credential_source.executable.command**.
483
+
- Fail in the following scenarios:
484
+
- The executable failed to complete in the timeout duration specified.
485
+
- The executable's response is invalid, was unsuccessful or expired.
486
+
- The executable finished with a non-zero exit code.
487
+
- Parse the executable response as JSON and then retrieve the external credential from
488
+
the field name based on the value of **token_type**.
489
+
- The token_type value must be **urn:ietf:params:oauth:token-type:jwt**,
490
+
**urn:ietf:params:oauth:token-type:id_token**, or **urn:ietf:params:oauth:token-type:saml2**.
491
+
- If the **token_type** is **urn:ietf:params:oauth:token-type:saml2**, the subject token will be parsed from the **saml_response** field.
492
+
- Otherwise it will be parsed from the **id_token** field.
493
+
378
494
## Changelog
379
495
380
496
-**2021-12-10**: Add AIP for External Account Credentials (AIP 4117).
0 commit comments