Skip to content

Commit 7eeefaa

Browse files
committed
Add a section for google-auth-library-cab-token-generator
1 parent 5aa51e6 commit 7eeefaa

File tree

1 file changed

+36
-14
lines changed

1 file changed

+36
-14
lines changed

README.md

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ Open source authentication client library for Java.
77

88
- [API Documentation](https://googleapis.dev/java/google-auth-library/latest)
99

10-
This project consists of 3 artifacts:
10+
This project consists of 4 artifacts:
1111

1212
- [*google-auth-library-credentials*](#google-auth-library-credentials): contains base classes and
1313
interfaces for Google credentials
1414
- [*google-auth-library-appengine*](#google-auth-library-appengine): contains App Engine
1515
credentials. This artifact depends on the App Engine SDK.
16-
- [*google-auth-library-oauth2-http*](#google-auth-library-oauth2-http): contains a wide variety of
17-
credentials as well as utility methods to create them and to get Application Default Credentials
16+
- [*google-auth-library-oauth2-http*](#google-auth-library-oauth2-http): contains
17+
a wide variety of credentials and utility methods, including functionality to get
18+
Application Default Credentials. Also provides the server-side approach for generating
19+
downscoped tokens.
20+
- [*google-auth-library-cab-token-generator*](#google-auth-library-cab-token-generator):
21+
provides the client-side approach for generating downscoped tokens.
1822

1923
**Table of contents:**
2024

@@ -991,23 +995,28 @@ to a token consumer via some secure authenticated channel for limited access to
991995
resources.
992996

993997
#### Generating Downscoped Tokens
998+
There are two ways to generate downscoped tokens using a CredentialAccessBoundary:
994999

995-
There are two ways to generate downscoped tokens using a
996-
CredentialAccessBoundary:
997-
998-
* **Server-side (using `DownscopedCredentials`):** The client calls the Security
1000+
* **Server-side (using `DownscopedCredentials`):** The client calls the Security
9991001
Token Service (STS) each time a downscoped token is needed. This is suitable for
10001002
applications where the Credential Access Boundary rules change infrequently or
1001-
when a single downscoped credential is reused many times. A key consideration
1002-
is that every rule change requires a new call to the STS.
1003+
when a single downscoped credential is reused many times. A key consideration
1004+
is that every rule change requires a new call to the STS. This approach is available
1005+
within the `google-auth-library-oauth2-http` library and does not require any additional
1006+
dependencies, making it simpler to integrate. It's a good choice if your use case
1007+
doesn't demand the specific benefits of the client-side approach.
10031008

10041009

10051010
* **Client-side (using `ClientSideCredentialAccessBoundaryFactory`):** The client
1006-
retrieves cryptographic material once and then generates multiple downscoped
1007-
tokens locally. This minimizes calls to the STS and is more efficient when
1008-
Credential Access Boundary rules change frequently, as the client doesn't need
1009-
to contact the STS for each rule change. This is also more efficient for
1010-
applications that need to generate many *unique* downscoped tokens.
1011+
retrieves cryptographic material once and then generates multiple downscoped tokens
1012+
locally. This minimizes calls to the STS and is more efficient when Credential Access
1013+
Boundary rules change frequently, as the client doesn't need to contact the STS
1014+
for each rule change. This is also more efficient for applications that need to
1015+
generate many *unique* downscoped tokens. This approach is available in the
1016+
`google-auth-library-cab-token-generator` module. However, this module comes with
1017+
its own set of dependencies, which can add complexity to your project. Consider
1018+
this approach if minimizing STS calls and generating numerous unique tokens are
1019+
primary concerns and you are willing to manage the additional dependencies.
10111020

10121021
#### Server-side CAB
10131022

@@ -1311,6 +1320,19 @@ Credentials credentials =
13111320
**Important: `com.google.auth.appengine.AppEngineCredentials` is a separate class from
13121321
`com.google.auth.oauth2.AppEngineCredentials`.**
13131322

1323+
## google-auth-library-cab-token-generator
1324+
1325+
This module provides the `ClientSideCredentialAccessBoundaryFactory` class,
1326+
enabling client-side generation of downscoped tokens for Cloud Storage using
1327+
Credential Access Boundaries. This approach is particularly useful for applications
1328+
requiring frequent changes to Credential Access Boundary rules or the generation
1329+
of many unique downscoped tokens, as it minimizes calls to the Security Token
1330+
Service (STS). For more details on when to consider this approach and how it
1331+
compares to the server-side method, see [Downscoping with Credential Access Boundaries](#downscoping-with-credential-access-boundaries).
1332+
For usage examples, see the [Client-side CAB](#client-side-cab) section.
1333+
This module comes with its own set of dependencies, so evaluate whether the
1334+
benefits of client-side downscoping outweigh the added complexity for your specific use case.
1335+
13141336
## CI Status
13151337

13161338
Java Version | Status

0 commit comments

Comments
 (0)