@@ -46,14 +46,14 @@ default location of this file can be changed using the
4646
4747``` json
4848{
49- “ version” : 1
49+ " version" : 1
5050 "cert_configs" : {
5151 "workload" : {
5252 "cert_path" : " path/to/cert/file"
5353 "key_path" : " path/to/key/file"
54- “ workload_identity_provider”: “ ...”
54+ " workload_identity_provider" : " ..."
5555 "authenticate_as_identity_type" : " gsa/native"
56- “ service_account_email”: “ ...”
56+ " service_account_email" : " ..."
5757 },
5858 "keychain" : {
5959 ...
@@ -73,75 +73,80 @@ default location of this file can be changed using the
7373
7474The following lists the fields relevant to mTLS token binding configuration:
7575
76- - ** "workload_identity_provider"** : The specified value will be used to
77- populate the request to Security Token Service (STS) to request
78- identity-bound access tokens. This value refers to the fully qualified name
79- of the workload identity pool and identity provider configured in IAM. The
80- specified value ** must** be of the following format.
76+ - ** "workload_identity_provider"** : The specified value will be used to
77+ populate the request to Security Token Service (STS) to request
78+ identity-bound access tokens. This value refers to the fully qualified name
79+ of the workload identity pool and identity provider configured in IAM. The
80+ specified value ** must** be of the following format.
8181
8282```
8383"workload_identity_provider":"//iam.googleapis.com/projects/<project_number>/locations/global/workloadIdentityPools/<pool_identifier>/providers/<provider_identifier>"
8484```
8585
86- - ** "authenticate_as_identity_type"** : This field specifies what identity is
87- used to authenticate to Google APIs. The value can be set to ` gsa ` or
88- ` native ` , where ` gsa ` is the GCP service account of the workload, e.g., the
89- GCP service account of a GCE VM, and ` native ` is the native workload
90- identity, e.g., the GKE pod kubernetes service account. If not specified,
91- the default value is ` gsa ` .
92-
93- - ** "service_account_email"** : If set, the specified value will be used to
94- populate the request to the IAM Credentials service to request
95- identity-bound access tokens. This value refers to the service account email
96- to be used for resource access. If not set, the service account email will
97- be determined automatically by querying the following Metadata Service
98- endpoint:
99- ` http://metadata/computeMetadata/v1/instance/service-accounts/default/email ` .
100- The value of this field is only relevant if
101- ** "authenticate_as_identity_type"** is set to ` gsa ` .
86+ - ** "authenticate_as_identity_type"** : This field specifies what identity is
87+ used to authenticate to Google APIs. The value can be set to ` gsa ` or
88+ ` native ` , where ` gsa ` is the GCP service account of the workload, e.g., the
89+ GCP service account of a GCE VM, and ` native ` is the native workload
90+ identity, e.g., the GKE pod kubernetes service account. If not specified,
91+ the default value is ` gsa ` .
92+
93+ - ** "service_account_email"** : If set, the specified value will be used to
94+ populate the request to the IAM Credentials service to request
95+ identity-bound access tokens. This value refers to the service account email
96+ to be used for resource access. If not set, the service account email will
97+ be determined automatically by querying the following Metadata Service
98+ endpoint:
99+ ` http://metadata/computeMetadata/v1/instance/service-accounts/default/email ` .
100+ The value of this field is only relevant if
101+ ** "authenticate_as_identity_type"** is set to ` gsa ` .
102102
103103The description of the ** "cert_path"** and ** "key_path"** fields can be found in
104104[ Mutual Authentication Using Workload Credentials] [ 2 ] .
105105
106106To enable using token binding when communicating with Google APIs the following
107107conditions are required:
108108
109- - [ Mutual Authentication Using Workload Credentials] [ 2 ] ** must** be enabled.
110- - The ** "workload_identity_provider"** ** must** be present,
111- ** "authenticate_as_identity_type"** __ may__ be set and
112- ** "service_account_email"** __ may__ be set in the ** "workload"**
113- section of the ** "~ /.config/gcloud/certificate_config.json"** configuration
114- file.
109+ - [ Mutual Authentication Using Workload Credentials] [ 2 ] ** must** be enabled.
110+
111+ - The ** "workload_identity_provider"** ** must** be present,
112+ ** "authenticate_as_identity_type"** __ may__ be set and
113+ ** "service_account_email"** __ may__ be set in the ** "workload"**
114+ section of the ** "~ /.config/gcloud/certificate_config.json"** configuration
115+ file.
115116
116117### Expected Behavior
117118
118119To support the usage of identity-bound access tokens, the auth libraries
119120** must** follow the steps below when sending requests to Google APIs:
120121
121- 1 . Connect to the mTLS endpoint of the [ STS API] [ 3 ] using the workload
122- credentials provisioned as described in [ Mutual Authentication Using
123- Workload Credentials] [ 2 ] . This endpoint ** must** be
124- ` sts.mtls.googleapis.com ` .
125- 1 . Send an HTTP request to STS’s [ ExchangeToken] [ 5 ] method requesting an
126- identity-bound token using the information in the
127- ** "workload_identity_provider"** field in the
128- ** "~ /.config/gcloud/certificate_config.json"** configuration file. The
129- scope of the requested token ** must** be
130- ` https://www.googleapis.com/auth/iam ` .
131- 1 . Connect to the mTLS endpoint of the [ IAM Credentials Service API] [ 4 ] using
132- the workload credentials provisioned as described in [ Mutual Authentication
133- Using Workload Credentials] [ 2 ] . This endpoint ** must** be
134- ` iamcredentials.mtls.googleapis.com ` .
135- 1 . If ** "authenticate_as_identity_type"** is set to ` gsa ` , send an HTTP
136- request to the IAM Credentials Service’s [ GenerateAccessToken] [ 6 ] method
137- requesting an identity bound token asserting the service account email in
138- the ** "service_account_email"** field in the
139- ** "~ /.config/gcloud/certificate_config.json"** configuration file. The
140- scope of this token ** must** be the same scope defined by the user for
141- accessing the requested Google API.
142- 1 . Attach the returned token in Step 4 to the request. Note that this request
143- ** must** be sent over an mTLS channel using the same workload credentials
144- in Step 1.
122+ 1 . Connect to the mTLS endpoint of the [ STS API] [ 3 ] using the workload
123+ credentials provisioned as described in [ Mutual Authentication Using
124+ Workload Credentials] [ 2 ] . This endpoint ** must** be
125+ ` sts.mtls.googleapis.com ` .
126+
127+ 1 . Send an HTTP request to STS’s [ ExchangeToken] [ 5 ] method requesting an
128+ identity-bound token using the information in the
129+ ** "workload_identity_provider"** field in the
130+ ** "~ /.config/gcloud/certificate_config.json"** configuration file. The
131+ scope of the requested token ** must** be
132+ ` https://www.googleapis.com/auth/iam ` .
133+
134+ 1 . Connect to the mTLS endpoint of the [ IAM Credentials Service API] [ 4 ] using
135+ the workload credentials provisioned as described in [ Mutual Authentication
136+ Using Workload Credentials] [ 2 ] . This endpoint ** must** be
137+ ` iamcredentials.mtls.googleapis.com ` .
138+
139+ 1 . If ** "authenticate_as_identity_type"** is set to ` gsa ` , send an HTTP
140+ request to the IAM Credentials Service’s [ GenerateAccessToken] [ 6 ] method
141+ requesting an identity bound token asserting the service account email in
142+ the ** "service_account_email"** field in the
143+ ** "~ /.config/gcloud/certificate_config.json"** configuration file. The
144+ scope of this token ** must** be the same scope defined by the user for
145+ accessing the requested Google API.
146+
147+ 1 . Attach the returned token in Step 4 to the request. Note that this request
148+ ** must** be sent over an mTLS channel using the same workload credentials
149+ in Step 1.
145150
146151<!-- prettier-ignore-start -->
147152[ 0 ] : https://google.aip.dev/auth/4110
0 commit comments