Skip to content

scalekit-inc/scalekit-sdk-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Official Java SDK

Maven Central License: MIT Javadoc

Scalekit is the auth stack for AI apps - from human authentication to agent authorization. Build secure AI products faster with authentication for humans (SSO, passwordless, full-stack auth) and agents (MCP/APIs, delegated actions), all unified on one platform. This Java SDK enables both traditional B2B authentication and cutting-edge agentic workflows.

πŸ€– Agent-First Features

  • πŸ” Agent Identity: Agents as first-class actors with human ownership and org context
  • 🎯 MCP-Native OAuth 2.1: Purpose-built for Model Context Protocol with DCR/PKCE support
  • ⏰ Ephemeral Credentials: Time-bound, task-based authorization (minutes, not days)
  • πŸ”’ Token Vault: Per-user, per-tool token storage with rotation and progressive consent
  • πŸ‘₯ Human-in-the-Loop: Step-up authentication when risk crosses thresholds
  • πŸ“Š Immutable Audit: Track which user initiated, which agent acted, what resource was accessed

πŸ‘¨β€πŸ’Ό Human Authentication

  • πŸ” Enterprise SSO: Support for SAML and OIDC protocols
  • πŸ‘₯ SCIM Provisioning: Automated user provisioning and deprovisioning
  • πŸš€ Passwordless Authentication: Magic links, OTP, and modern auth flows
  • 🏒 Multi-tenant Architecture: Organization-level authentication policies
  • πŸ“± Social Logins: Support for popular social identity providers
  • πŸ›‘οΈ Full-Stack Auth: Complete IdP-of-record solution for B2B SaaS
πŸ“š Documentation β€’ πŸš€ SSO Quickstart β€’ πŸ’» API Reference

Pre-requisites

  1. Sign up for a Scalekit account.
  2. Get your env_url, client_id and client_secret from the Scalekit dashboard.

Installation

Requirements

  • Java 1.8 or later

Gradle users

Add this dependency to your project's build file:

implementation "com.scalekit:scalekit-sdk-java:2.0.4"

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>com.scalekit</groupId>
    <artifactId>scalekit-sdk-java</artifactId>
    <version>2.0.4</version>
</dependency>

Usage

Initialize the Scalekit client using the appropriate credentials. Refer code sample below.

import com.scalekit.ScalekitClient;
import com.scalekit.exceptions.APIException;
import com.scalekit.grpc.scalekit.v1.organizations.CreateOrganization;
import com.scalekit.grpc.scalekit.v1.organizations.Organization;
import com.scalekit.grpc.scalekit.v1.organizations.UpdateOrganization;

public class ScalekitExample {

    public static void main(String[] args) {
        client = new ScalekitClient("env_url",
                "client_id",
                "client_secret");
        }
}
Minimum Requirements

The Scalekit Java SDK is designed to operate with the following environment:

Component Version
Java 8+

Tip: While our Java SDK requires Java 8 as the baseline, we suggest upgrading to more recent LTS versions such as Java 11 or Java 17. These updates deliver performance improvements and enhanced security.

Examples - SSO with Spring Boot

Below is a simple code sample that showcases how to implement Single Sign-on using Scalekit SDK

@RestController
public class AuthController {
    ScalekitClient scalekitClient = client = new ScalekitClient("env_url", "client_id", "client_secret");

    @Value("${auth.redirect.url}")
    private String redirectUrl;

    @PostMapping( path = "auth/login")
    public RedirectView loginHandler() {
        AuthorizationUrlOptions options = new AuthorizationUrlOptions();
        String url = scalekitClient.authentication().
                getAuthorizationUrl(redirectUrl, options)
                .toString();
        return new RedirectView(url);
    }

    @GetMapping("auth/callback")
    public String callbackHandler(@RequestParam String code, HttpServletResponse response){
        
        AuthenticationResponse authResponse = scalekitClient.authentication()
                .authenticateWithCode(code, redirectUrl, new AuthenticationOptions());
        Cookie cookie = new Cookie("access_token", authResponse.getAccessToken());
        response.addCookie(cookie);
        return authResponse.getIdToken();
    }
}

πŸ“± Example Apps

Explore fully functional sample applications built with popular Java frameworks and the Scalekit SDK:

Framework Repository Description
Spring Boot scalekit-springboot-example Complete Spring Boot integration

πŸ”— Helpful Links

πŸ“– Quickstart Guides

πŸ“š Documentation & Reference

πŸ› οΈ Additional Resources

License

This project is licensed under the MIT license.

About

Java SDK for enterprise authentication - Spring Boot compatible SAML and OIDC integration

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5

Languages