Skip to main content

Java SDK

The Java SDK integrates Spring Security resource servers and server-side management clients. Use a WEB or M2M confidential ApplicationClient for the core integration. The optional Java BFF module adds Hosted/custom server sessions to Spring applications.

Build and install locally​

The SDK is not currently available on Maven Central. Build the recorded source commit with JDK 21 or newer:

git clone https://github.com/axis-iam/vertex-sdk-java.git
cd vertex-sdk-java
git checkout 9b7d1c84cbd051a52b08f5c51a3838c2c92cceb8
bash gradlew :vertex-sdk-core:publishToMavenLocal

Scope the local Maven repository to Axis Vertex in settings.gradle.kts; use Maven Central for third-party dependencies:

dependencyResolutionManagement {
repositories {
exclusiveContent {
forRepository { mavenLocal() }
filter { includeGroup("com.chaosguide.iam") }
}
mavenCentral()
}
}

Use the version currently declared by that source checkout in build.gradle.kts:

dependencies {
implementation("com.chaosguide.iam:vertex-sdk-core:0.1.0")
}

Quickstart​

import com.chaosguide.iam.vertex.EnableIamSecurity;
import com.chaosguide.iam.vertex.authz.PermissionKey;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableIamSecurity
class VertexSecurityConfiguration {
static final PermissionKey ORDERS_READ = new PermissionKey("orders", "read");
}

Configure the Spring backend with its own WEB/M2M confidential client under the same Application as the browser client:

iam:
sdk:
endpoint: https://auth.example.com
client-id: ${IAM_CLIENT_ID}
client-secret: ${IAM_CLIENT_SECRET}
resource-audience: ${IAM_RESOURCE_AUDIENCE}
fail-mode: CLOSE

endpoint is the Vertex issuer. The client ID and secret belong to this backend, not the SPA/NATIVE client. The SDK derives issuer/JWKS metadata, verifies bearer tokens, and resolves current permissions through Vertex; it does not trust a permissions claim from the token. Keep the secret in server-side configuration.

Resource server and management boundary​

Use @EnableIamSecurity and @RequirePerm for incoming user bearer tokens. Use PortalOpenApiClient only for server-side management automation with a separate M2M client and exact scopes such as roles:read or registration_grants:write. Do not expose PortalOpenApiClient, its secret, or management responses to browser code.

Set iam.sdk.resource-audience to the Application's resource audience. It is required: configuration fails closed when it is missing. The decoder validates ES256/RS256 signatures, issuer, audience, expiry and not-before claims. The audience is an API identifier, not the browser or server client ID.

Permission Manifest publication is an explicit server-side operation. Auto-configuration never publishes or changes permissions on application startup.

Reference​

Gradle Javadoc owns the callable Java reference. The docs build links the generated output after checking public classes against the source module surface: