Skip to content
Dashboard
Theme
Theme

Java SDK

The OhAuthCat server SDK for Java 17 and later.

View Markdown

Java 17 or later, standard library only.

<dependency>
<groupId>com.ohauthcat</groupId>
<artifactId>ohauthcat</artifactId>
<version>0.0.2</version>
</dependency>
  • Create a client: OhAuthCatClient.builder(System.getenv("OHAUTHCAT_API_KEY")).clientId("pk_...").build().
  • Call any API operation, for example client.organizations.getOrganization("org_..."). List calls have auto-paging variants such as listDirectoryUsersAutoPaging.
  • SSO: client.ssoHelpers.getAuthorizationUrl(options) returns the URL and the PKCE codeVerifier() to keep; after the redirect, client.ssoHelpers.getProfileAndToken(code, codeVerifier, redirectUri).
  • Webhooks: Webhooks.verify(rawBody, signatureHeader, secret) checks the OhAuthCat-Signature of the raw bytes before you parse them.
  • Errors are OhAuthCatException subclasses by type, such as NotFound and RateLimited, with the stable code().
  • Set your own idempotency key with RequestOptions.create().idempotencyKey(...).