Skip to content

Commit 3f9f396

Browse files
committed
Address the review comments
1 parent 668a735 commit 3f9f396

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ information, refer to [documentation](https://cloud.google.com/docs/authenticati
4444
* [Accessing resources from AWS](#accessing-resources-from-aws)
4545
* [Accessing resources from Azure](#access-resources-from-microsoft-azure)
4646
* [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)
4748
* [Accessing resources using Executable-sourced credentials](#using-executable-sourced-credentials-with-oidc-and-saml)
4849
* [Accessing resources using a custom supplier for OIDC or SAML](#using-a-custom-supplier-with-oidc-and-saml)
4950
* [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
368369
The configuration file can be generated by using the [gcloud CLI](https://cloud.google.com/sdk/).
369370

370371
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
372374
certificate and private-key combination (X.509 certificate-sourced credentials).
373375

374-
**File-sourced credentials**
376+
#### File-sourced credentials
375377
For file-sourced credentials, a background process needs to be continuously refreshing the file
376378
location with a new OIDC token prior to expiration. For tokens with one hour lifetimes, the token
377379
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:
402404

403405
This generates the configuration file in the specified output file.
404406

405-
**URL-sourced credentials**
407+
#### URL-sourced credentials
406408
For URL-sourced credentials, a local server needs to host a GET endpoint to return the OIDC token.
407409
The response can be in plain text or JSON. Additional required request headers can also be
408410
specified.
@@ -437,18 +439,20 @@ You can now [use the Auth library](#using-external-identities) to call Google Cl
437439
resources from an OIDC provider.
438440

439441
### 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.
441445

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.
443448

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.
446450

447451
The location where the certificate configuration file is created depends on whether you use the `--credential-cert-configuration-output-file` flag.
448452

449453
**Default Behavior (Recommended)**
450454

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`.
452456

453457
Example Command (Default Behavior):
454458

0 commit comments

Comments
 (0)