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
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@ information, refer to [documentation](https://cloud.google.com/docs/authenticati
44
44
*[Accessing resources from AWS](#accessing-resources-from-aws)
45
45
*[Accessing resources from Azure](#access-resources-from-microsoft-azure)
46
46
*[Accessing resources from an OIDC identity provider](#accessing-resources-from-an-oidc-identity-provider)
47
+
*[Accessing resources using X.509 certificate-sourced credentials](#accessing-resources-using-x509-certificate-sourced-credentials)
47
48
*[Accessing resources using Executable-sourced credentials](#using-executable-sourced-credentials-with-oidc-and-saml)
48
49
*[Accessing resources using a custom supplier for OIDC or SAML](#using-a-custom-supplier-with-oidc-and-saml)
49
50
*[Accessing resources using a custom supplier with AWS](#using-a-custom-supplier-with-aws)
@@ -368,10 +369,11 @@ retrieve external subject tokens and exchange them for service account access to
368
369
The configuration file can be generated by using the [gcloud CLI](https://cloud.google.com/sdk/).
369
370
370
371
For OIDC providers, the Auth library can retrieve OIDC tokens from a local file
371
-
(file-sourced credentials), a local server (URL-sourced credentials), or a X.509
372
+
([file-sourced credentials](#file-sourced-credentials)), a local server
373
+
([URL-sourced credentials](#url-sourced-credentials)), or a X.509
372
374
certificate and private-key combination (X.509 certificate-sourced credentials).
373
375
374
-
**File-sourced credentials**
376
+
#### File-sourced credentials
375
377
For file-sourced credentials, a background process needs to be continuously refreshing the file
376
378
location with a new OIDC token prior to expiration. For tokens with one hour lifetimes, the token
377
379
needs to be updated in the file every hour. The token can be stored directly as plain text or in
@@ -402,7 +404,7 @@ Where the following variables need to be substituted:
402
404
403
405
This generates the configuration file in the specified output file.
404
406
405
-
**URL-sourced credentials**
407
+
#### URL-sourced credentials
406
408
For URL-sourced credentials, a local server needs to host a GET endpoint to return the OIDC token.
407
409
The response can be in plain text or JSON. Additional required request headers can also be
408
410
specified.
@@ -437,18 +439,20 @@ You can now [use the Auth library](#using-external-identities) to call Google Cl
437
439
resources from an OIDC provider.
438
440
439
441
### Accessing resources using X.509 certificate-sourced credentials
440
-
For X.509 certificate-sourced credentials, the authentication library uses an X.509 certificate and private key to prove your application's identity. The certificate has a built-in expiration date and must be renewed to maintain access.
442
+
For more information, see the [official documentation](https://cloud.google.com/iam/docs/workload-identity-federation-with-x509-certificates).
443
+
444
+
For X.509 certificate-sourced credentials, the authentication library uses an X.509 certificate and private key to prove your application's identity. The certificate has a built-in expiration date, which is defined in the certificate itself, and must be renewed to maintain access.
441
445
442
-
The library constructs a subject token by creating a JSON array containing the base64-encoded leaf certificate, followed by any intermediate certificates from a provided trust chain.
446
+
#### Prerequisites: Generating Configuration Files for X.509 Federation
447
+
To configure X.509 certificate-sourced credentials, you need to generate two separate configuration files: a primary **credential configuration file** and a **certificate configuration file**. The primary credential configuration file contains the necessary metadata for authentication, and it points to the certificate configuration file, which contains the paths to the X.509 certificate, private key, and trust chain.
443
448
444
-
#### Generating Configuration Files for X.509 Federation
445
-
To configure X.509 certificate-sourced credentials, you need to generate two separate configuration files: a primary **credential configuration file** and a **certificate configuration file**. The `gcloud iam workload-identity-pools create-cred-config` command can be used to create both.
449
+
The [`gcloud iam workload-identity-pools create-cred-config`](https://cloud.google.com/sdk/gcloud/reference/iam/workload-identity-pools/create-cred-config) command can be used to create both.
446
450
447
451
The location where the certificate configuration file is created depends on whether you use the `--credential-cert-configuration-output-file` flag.
448
452
449
453
**Default Behavior (Recommended)**
450
454
451
-
If you omit the `--credential-cert-configuration-output-file` flag, gcloud creates the certificate configuration file at a default, well-known location that the auth library can automatically discover. This is the simplest approach for most use cases.
455
+
If you omit the `--credential-cert-configuration-output-file` flag, gcloud creates the certificate configuration file at a default, well-known location that the auth library can automatically discover. This is the simplest approach for most use cases. The default credential configuration file is named `config.json` and the default certificate configuration file is named `certificate_config.json`.
0 commit comments