From ea8c24d23729b9e87bd1d3c01630ea1d7a75c73c Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Fri, 3 Oct 2025 10:33:54 -0700 Subject: [PATCH 1/4] Add document for java sdk aws auth login --- docs/sdks/languages/java.mdx | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/sdks/languages/java.mdx b/docs/sdks/languages/java.mdx index 7ead4d3dd..dba1191fd 100644 --- a/docs/sdks/languages/java.mdx +++ b/docs/sdks/languages/java.mdx @@ -131,6 +131,58 @@ sdk.Auth().LdapAuthLogin(input); - `username` (String): The LDAP username. - `password` (String): The LDAP password. +### AWS Auth + +```java +public void AwsAuthLogin( + AwsAuthLoginInput input +) +throws InfisicalException +``` + +```java +var input = AwsAuthLoginInput + .builder() + .identityId("") + .iamHttpRequestMethod("") + .iamRequestHeaders("") + .iamRequestBody("") + .build(); + +sdk.Auth().AwsAuthLogin(input); +``` + +**Parameters:** +- `input` (AwsAuthLoginInput): The input for authenticating with AWS. + - `identityId` (String): The ID of the machine identity to authenticate with. + - `iamHttpRequestMethod` (String): The HTTP request method used in the signed request. + - `iamRequestHeaders` (String): The base64-encoded headers of the sts:GetCallerIdentity signed request. + - `iamRequestBody` (String): The base64-encoded body of the signed request. Most likely, the base64-encoding of Action=GetCallerIdentity&Version=2011-06-15. + +Generating the login input requires retrieving AWS credentials from the current local environment and performing an AWS Signature Version 4 on the retrieved data. +To make it much easier for users, we provide a helper class to automatically generate the login input for you. + +```java +import com.infisical.sdk.auth.AwsAuthProvider; +var input = AwsAuthProvider.defaultProvider() + .fromInstanceProfile() + .toLoginInput(""); +``` + +If you prefer to retrieve AWS credentials manually from your local AWS environment, you can generate the login input by providing the AWS credentials yourself, as shown below: + +```java +import com.infisical.sdk.auth.AwsAuthProvider; +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +var input = AwsAuthProvider.defaultProvider() + .fromCredentials( + "", + AwsBasicCredentials.create("", ""), + "" + ) + .toLoginInput(""); +``` + ### Access Token Auth #### Authenticating From eb64a73799b181341ec7b9ba3d9b163d6836705c Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Fri, 3 Oct 2025 10:37:30 -0700 Subject: [PATCH 2/4] Move doc section around to match the one in API doc --- docs/sdks/languages/java.mdx | 52 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/sdks/languages/java.mdx b/docs/sdks/languages/java.mdx index dba1191fd..6e949b118 100644 --- a/docs/sdks/languages/java.mdx +++ b/docs/sdks/languages/java.mdx @@ -105,32 +105,6 @@ sdk.Auth().UniversalAuthLogin( - `clientId` (string): The client ID of your Machine Identity. - `clientSecret` (string): The client secret of your Machine Identity. -### LDAP Auth - -```java -public void LdapAuthLogin( - LdapAuthLoginInput input -) -throws InfisicalException -``` - -```java -var input = LdapAuthLoginInput - .builder() - .identityId("") - .username("") - .password("") - .build(); - -sdk.Auth().LdapAuthLogin(input); -``` - -**Parameters:** -- `input` (LdapAuthLoginInput): The input for authenticating with LDAP. - - `identityId` (String): The ID of the machine identity to authenticate with. - - `username` (String): The LDAP username. - - `password` (String): The LDAP password. - ### AWS Auth ```java @@ -183,6 +157,32 @@ var input = AwsAuthProvider.defaultProvider() .toLoginInput(""); ``` +### LDAP Auth + +```java +public void LdapAuthLogin( + LdapAuthLoginInput input +) +throws InfisicalException +``` + +```java +var input = LdapAuthLoginInput + .builder() + .identityId("") + .username("") + .password("") + .build(); + +sdk.Auth().LdapAuthLogin(input); +``` + +**Parameters:** +- `input` (LdapAuthLoginInput): The input for authenticating with LDAP. + - `identityId` (String): The ID of the machine identity to authenticate with. + - `username` (String): The LDAP username. + - `password` (String): The LDAP password. + ### Access Token Auth #### Authenticating From 24cbc51f32282943d30e8b1c80f3fa18d1f262dd Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Fri, 3 Oct 2025 14:43:50 -0700 Subject: [PATCH 3/4] Update doc with the new overloaded method --- docs/sdks/languages/java.mdx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/sdks/languages/java.mdx b/docs/sdks/languages/java.mdx index 6e949b118..129aaafa2 100644 --- a/docs/sdks/languages/java.mdx +++ b/docs/sdks/languages/java.mdx @@ -143,6 +143,21 @@ var input = AwsAuthProvider.defaultProvider() .toLoginInput(""); ``` +Since this is the most common use case for AWS authentication, we also provide an overloaded method for `AwsAuthLogin`: + +```java +public void AwsAuthLogin( + String identityId +) +throws InfisicalException +``` + +With this method, you can pass in the `identityId`, and it will retrieve AWS credentials automatically for you from your current environment: + +```java +sdk.Auth().AwsAuthLogin(""); +``` + If you prefer to retrieve AWS credentials manually from your local AWS environment, you can generate the login input by providing the AWS credentials yourself, as shown below: ```java From 898db6ba94b84359d6e5f28163bf6c8ee5a48dd9 Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Fri, 3 Oct 2025 16:14:27 -0700 Subject: [PATCH 4/4] Remove other docs, focus on the identity id use case --- docs/sdks/languages/java.mdx | 55 ++---------------------------------- 1 file changed, 2 insertions(+), 53 deletions(-) diff --git a/docs/sdks/languages/java.mdx b/docs/sdks/languages/java.mdx index 129aaafa2..f6ddaad58 100644 --- a/docs/sdks/languages/java.mdx +++ b/docs/sdks/languages/java.mdx @@ -107,44 +107,6 @@ sdk.Auth().UniversalAuthLogin( ### AWS Auth -```java -public void AwsAuthLogin( - AwsAuthLoginInput input -) -throws InfisicalException -``` - -```java -var input = AwsAuthLoginInput - .builder() - .identityId("") - .iamHttpRequestMethod("") - .iamRequestHeaders("") - .iamRequestBody("") - .build(); - -sdk.Auth().AwsAuthLogin(input); -``` - -**Parameters:** -- `input` (AwsAuthLoginInput): The input for authenticating with AWS. - - `identityId` (String): The ID of the machine identity to authenticate with. - - `iamHttpRequestMethod` (String): The HTTP request method used in the signed request. - - `iamRequestHeaders` (String): The base64-encoded headers of the sts:GetCallerIdentity signed request. - - `iamRequestBody` (String): The base64-encoded body of the signed request. Most likely, the base64-encoding of Action=GetCallerIdentity&Version=2011-06-15. - -Generating the login input requires retrieving AWS credentials from the current local environment and performing an AWS Signature Version 4 on the retrieved data. -To make it much easier for users, we provide a helper class to automatically generate the login input for you. - -```java -import com.infisical.sdk.auth.AwsAuthProvider; -var input = AwsAuthProvider.defaultProvider() - .fromInstanceProfile() - .toLoginInput(""); -``` - -Since this is the most common use case for AWS authentication, we also provide an overloaded method for `AwsAuthLogin`: - ```java public void AwsAuthLogin( String identityId @@ -152,25 +114,12 @@ public void AwsAuthLogin( throws InfisicalException ``` -With this method, you can pass in the `identityId`, and it will retrieve AWS credentials automatically for you from your current environment: - ```java sdk.Auth().AwsAuthLogin(""); ``` -If you prefer to retrieve AWS credentials manually from your local AWS environment, you can generate the login input by providing the AWS credentials yourself, as shown below: - -```java -import com.infisical.sdk.auth.AwsAuthProvider; -import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; -var input = AwsAuthProvider.defaultProvider() - .fromCredentials( - "", - AwsBasicCredentials.create("", ""), - "" - ) - .toLoginInput(""); -``` +**Parameters:** +- `identityId` (String): The ID of the machine identity to authenticate with. ### LDAP Auth