Skip to content

Commit 0d0bedf

Browse files
committed
docs: add documentation
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
1 parent d49ca7d commit 0d0bedf

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Authentication.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,13 @@ The IAM access token is added to each outbound request in the `Authorization` he
464464
The default value of this property is `http://169.254.169.254`. However, if the VPC Instance Metadata Service is configured
465465
with the HTTP Secure Protocol setting (`https`), then you should configure this property to be `https://api.metadata.cloud.ibm.com`.
466466

467+
- serviceVersion: (optional) The VPC Instance Metadata Service version to use.
468+
The default value is `2022-03-01`. When set to `2025-08-26`, the authenticator will use the new API paths
469+
(`/identity/v1/token` and `/identity/v1/iam_tokens`) instead of the legacy paths.
470+
471+
- tokenLifetime: (optional) The lifetime (in seconds) of the instance identity token.
472+
The default value is `300` seconds. This property can only be configured programmatically (not via environment variables).
473+
467474
Usage Notes:
468475
1. At most one of `iamProfileCrn` or `iamProfileId` may be specified. The specified value must map
469476
to a trusted IAM profile that has been linked to the compute resource (virtual server instance).
@@ -491,12 +498,27 @@ ExampleService service = new ExampleService(ExampleService.DEFAULT_SERVICE_NAME,
491498
// 'service' can now be used to invoke operations.
492499
```
493500

501+
To use the new service version with custom token lifetime:
502+
```java
503+
// Create the authenticator with new service version.
504+
VpcInstanceAuthenticator authenticator = new VpcInstanceAuthenticator.Builder()
505+
.serviceVersion("2025-08-26")
506+
.tokenLifetime(600)
507+
.build();
508+
```
509+
494510
### Configuration example
495511
External configuration:
496512
```
497513
export EXAMPLE_SERVICE_AUTH_TYPE=vpc
498514
export EXAMPLE_SERVICE_IAM_PROFILE_CRN=crn:iam-profile-123
499515
```
516+
To use the new service version:
517+
```
518+
export EXAMPLE_SERVICE_AUTH_TYPE=vpc
519+
export EXAMPLE_SERVICE_IAM_PROFILE_CRN=crn:iam-profile-123
520+
export EXAMPLE_SERVICE_VPC_IMS_VERSION=2025-08-26
521+
```
500522
Application code:
501523
```java
502524
import <sdk_base_package>.ExampleService.v1.ExampleService;

0 commit comments

Comments
 (0)