Skip to content

Commit be1213e

Browse files
authored
feat: updating readme for external account authorized user credentials (#1200)
Adds readme section for workforce external account authorized user credentials
1 parent c6df6a2 commit be1213e

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

google-auth-library-java/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ credentials as well as utility methods to create them and to get Application Def
3232
* [Configurable Token Lifetime](#configurable-token-lifetime)
3333
* [Workforce Identity Federation](#workforce-identity-federation)
3434
* [Accessing resources using an OIDC or SAML 2.0 identity provider](#accessing-resources-using-an-oidc-or-saml-20-identity-provider)
35+
* [Accessing resources using external account authorized user workforce credentials](#using-external-account-authorized-user-workforce-credentials)
3536
* [Accessing resources using Executable-sourced credentials](#using-executable-sourced-workforce-credentials-with-oidc-and-saml)
3637
* [Downscoping with Credential Access Boundaries](#downscoping-with-credential-access-boundaries)
3738
* [Configuring a Proxy](#configuring-a-proxy)
@@ -622,6 +623,29 @@ Where the following variables need to be substituted:
622623
`$URL_TO_GET_SAML_ASSERTION`, e.g. `Metadata-Flavor=Google`.
623624
- `$WORKFORCE_POOL_USER_PROJECT`: The project number associated with the [workforce pools user project](https://cloud.google.com/iam/docs/workforce-identity-federation#workforce-pools-user-project).
624625

626+
#### Using external account authorized user workforce credentials
627+
628+
[External account authorized user credentials](https://cloud.google.com/iam/docs/workforce-obtaining-short-lived-credentials#browser-based-sign-in) allow you to sign in with a web browser to an external identity provider account via the
629+
gcloud CLI and create a configuration for the auth library to use.
630+
631+
To generate an external account authorized user workforce identity configuration, run the following command:
632+
633+
```bash
634+
gcloud auth application-default login --login-config=$LOGIN_CONFIG
635+
```
636+
637+
Where the following variable needs to be substituted:
638+
- `$LOGIN_CONFIG`: The login config file generated with the cloud console or
639+
[gcloud iam workforce-pools create-login-config](https://cloud.google.com/sdk/gcloud/reference/iam/workforce-pools/create-login-config)
640+
641+
This will open a browser flow for you to sign in via the configured third party identity provider
642+
and then will store the external account authorized user configuration at the well known ADC location.
643+
The auth library will then use the provided refresh token from the configuration to generate and refresh
644+
an access token to call Google Cloud services.
645+
646+
Note that the default lifetime of the refresh token is one hour, after which a new configuration will need to be generated from the gcloud CLI.
647+
The lifetime can be modified by changing the [session duration of the workforce pool](https://cloud.google.com/iam/docs/reference/rest/v1/locations.workforcePools), and can be set as high as 12 hours.
648+
625649
#### Using Executable-sourced workforce credentials with OIDC and SAML
626650

627651
**Executable-sourced credentials**

0 commit comments

Comments
 (0)