Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: "17"
java-version: "21"
distribution: "temurin"
cache: maven

Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The SDK methods are organized into the following high-level categories:

The `Auth` component provides methods for authentication:

#### Universal Auth
### Universal Auth

#### Authenticating
```java
Expand All @@ -86,10 +86,20 @@ sdk.Auth().UniversalAuthLogin(
);
```


**Parameters:**
- `clientId` (string): The client ID of your Machine Identity.
- `clientSecret` (string): The client secret of your Machine Identity.

### Access Token Auth

#### Authenticating
```java
sdk.Auth().SetAccessToken("ACCESS_TOKEN");
```

**Parameters:**
- `accessToken` (string): The access token you want to use for authentication.

### `Secrets`

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/infisical/sdk/resources/AuthClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ public void UniversalAuthLogin(String clientId, String clientSecret) throws Infi
var credential = this.apiClient.post(url, params, MachineIdentityCredential.class);
this.onAuthenticate.accept(credential.getAccessToken());
}

public void SetAccessToken(String accessToken) {
this.onAuthenticate.accept(accessToken);
}
}