smart-sso is a free, open source identity & access management (iam) project written in Java and released under MIT. It has 2,300 GitHub stars, 1,218 forks and 49 open issues, and was last pushed 4 days ago. On this registry it ranks #32 of 70 tracked projects in Identity & Access Management (IAM), with 5 head-to-head comparisons available.

What is smart-sso?

Smart-SSO is a lightweight, MIT-licensed single sign-on authentication and authorization centre built on Spring Boot 3 and the OAuth 2.0 authorization-code flow, aimed at Java teams that need one login to cover a set of separate client applications without adopting a heavyweight identity platform.

What it is

Smart-SSO is a Java server application that acts as a central authentication and authorization authority for a family of client applications. It implements the OAuth 2.0 authorization-code flow on Spring Boot 3, requires JDK 17+ and Maven 3.8+, and is distributed under the MIT licence. The project is organised as a multi-module Maven build, with a server module (smart-sso-server), a client starter (smart-sso-starter-client) and a runnable client example (smart-sso-demo). Its topic list — authentication, authorization, oauth2-provider, sso — describes the scope precisely: it is both the identity provider and the permission source for the applications that integrate with it.

The concrete problem it solves is the duplication that appears when several applications each maintain their own login and permission model. Rather than building session sharing, token refresh and logout propagation per application, a team points each client at the server and lets auto-configuration install the required filters. The thing it replaces is that hand-rolled, per-application authentication layer: the README frames the project as a minimal implementation with "no extra moving parts", and client integration is reduced to three steps — add the smart-sso-starter-client dependency, configure smart.sso.*, and let auto-configuration wire the filters.

Key capabilities

  • Single sign-on across client applications: a user logs in once on any client and the remaining clients follow, with the server also acting as a client of itself in the demo.
  • Single logout with implicit client registration: each client registers its own logout URI when fetching a token, and logging out anywhere makes the server notify every related client to drop its local token.
  • Silent renewal: when the access token expires, the client backend refreshes it with the refresh token and extends the server-side stub, transparently to the user.
  • Forced logout: an administrator can terminate a user's session, after which the server revokes the credentials and notifies all related clients to clear their local sessions.
  • Button-level permissions classified as menus or functions and exposed as stable codes reusable across endpoints, with per-application authorization isolation.
  • Distributed deployment through Redis-backed implementations for both server and client, sharing credentials and permissions across instances.
  • A zero-dependency demo mode that runs on an embedded H2 database and executes smart-sso-server/src/main/resources/init.sql at startup to create tables and seed demo data.

Who uses it and how

  • Java teams running several internal applications that need a shared login and a shared permission model, integrated through the smart-sso-starter-client dependency and smart.sso.* configuration.
  • Administrators who need an operational lever to terminate a specific user's session across every connected application, using the forced-logout capability.
  • Teams deploying the server and clients across multiple instances, where Redis supplies the shared credential and permission store.
  • Developers and test engineers using the dev profile for demos, integration work and automated tests, since the in-memory H2 data lasts only for the lifetime of the process and a restart resets everything.
  • Production deployments running the prod profile against MySQL 5.7+/8.0, where the SQL script is never executed at startup and therefore cannot wipe existing data.

Getting started

The recommended path is the zero-dependency demo: clone the repository, run mvn -DskipTests package, then java -jar smart-sso-server/target/smart-sso-server-2.1.0.jar, open http://localhost:8080 and sign in with the built-in admin / 123456 account. For production, create the smart-sso schema, import the SQL script into MySQL and run under the prod profile.

How it compares

No paid products or comparable tools are named in the facts supplied for this entry, so it stands alone in this registry rather than being positioned against alternatives. The contrast that can be drawn is internal: the demo profile trades persistence for convenience, while the prod profile trades the single-command start for a MySQL dependency.

When to use it — and when not

Choose Smart-SSO when the estate is Java and Spring Boot 3 based, the requirement is OAuth 2.0 authorization-code SSO with menu and function level permissions, and the team is willing to operate MySQL for production and Redis if it needs distributed deployment. Do not use the default dev profile for anything that must survive a restart, because the in-memory H2 database is reset on every boot. The documentation is a further consideration: the README states that English guides for client integration, architecture, configuration and FAQ live under docs/, while the Chinese originals remain the primary text, so teams without Chinese readers should check those guides before committing.

project readme (upstream, from github) — read inline

Smart-SSO

License JDK Spring Boot PRs Welcome GitHub stars Gitee stars Gitcode stars

English | 简体中文

Smart-SSO is a lightweight authentication and authorization center (SSO) built on Spring Boot 3 and the OAuth 2.0 authorization-code flow. It ships SSO login/logout, silent token renewal, forced logout, button-level permissions and distributed deployment support — plus a zero-dependency demo mode that starts with a single command, no database required.

English guides for client integration, architecture, configuration and frequently asked questions are available under docs/. Chinese originals remain available from the language switcher.


Features

  1. Lightweight — minimal implementation on Spring Boot 3 + OAuth 2.0 authorization code, no extra moving parts.
  2. Single sign-on — log in once on any client application, the rest follow.
  3. Single logout — each client implicitly registers its own logout URI when fetching a token; logging out anywhere makes the server notify every related client to drop its local token.
  4. Silent renewal — when the access token expires, the client backend refreshes it with the refresh token and extends the server-side stub, transparently to the user.
  5. Forced logout — an administrator can terminate a user's session; the server revokes the credentials and notifies all related clients to clear their local sessions.
  6. Button-level permissions — permissions are classified as menus or functions and exposed as stable codes that can be reused across endpoints, with per-application authorization isolation.
  7. Distributed deployment — Redis-backed implementations for both server and client, sharing credentials and permissions across instances.

Quick Start

Requirements

Component Requirement
JDK 17+
Maven 3.8+
Database Not required (embedded H2 by default); MySQL 5.7+/8.0 recommended for production
Redis Optional (distributed deployment only)

Option 1 — Zero-dependency demo (recommended)

git clone https://github.com/a466350665/smart-sso.git
cd smart-sso
mvn -DskipTests package
java -jar smart-sso-server/target/smart-sso-server-2.1.0.jar

Open http://localhost:8080 and sign in with the built-in account admin / 123456. (Server also a client of itself)

  • The dev profile is active by default: it uses an in-memory H2 database and executes smart-sso-server/src/main/resources/init.sql on startup to create tables and seed demo data.
  • Data lives only for the lifetime of the process — restarting resets everything, which is ideal for demos, integration work and automated tests.

Option 2 — MySQL (production)

# 1. Create the schema and import (the script works for both MySQL and H2)
mysql -uroot -p -e "CREATE DATABASE IF NOT EXISTS \`smart-sso\` DEFAULT CHARSET utf8mb4"
mysql -uroot -p --default-character-set=utf8mb4 smart-sso < smart-sso-server/src/main/resources/init.sql

# 2. Adjust smart-sso-server/src/main/resources/application-prod.yaml, then start
java -jar smart-sso-server/target/smart-sso-server-2.1.0.jar --spring.profiles.active=prod

The prod profile uses MySQL and never runs the SQL script (Spring Boot only initializes embedded databases by default), so startup cannot wipe your data.

Client example

java -jar smart-sso-demo/target/smart-sso-demo-2.1.0.jar

Client example. Open http://localhost:8082, no need to log in again. It will automatically redirect you to the homepage.

Client Integration

Integrating a client takes three steps: add the smart-sso-starter-client dependency, configure smart.sso.*, and let auto-configuration install the filters that handle interception and login redirects. Minimal configuration:

smart:
  sso:
    server-url: http://localhost:8080   # required for a standalone client
    client-id: 1000                     # issued by the server after registering the app
    client-secret: xxxxxxxx
    exclude-urls: /static/*,/auth/*     # paths reachable without login

Full guide (dependency coordinates, filter behaviour, cookie-less mode, cross-domain setups, pitfalls): see docs/client-integration.en.md.

Architecture

The example below uses two applications: after signing in on App A, visiting App B from the same browser requires no credentials.

sequenceDiagram
    autonumber
    participant B as Browser
    participant A as App A
    participant S as SSO server
    participant X as App B

    Note over B,X: 1) First login: sign in once on App A
    B->>A: Access a protected resource of App A
    A-->>B: 302 to /sso/login?clientId=A
    B->>S: GET /sso/login
    S-->>B: No TGT, 302 to the login page
    B->>S: POST /sso/login with credentials
    S->>S: Create TGT, set the TGC cookie
    S-->>B: Redirect back to redirectUri?code=..
    B->>A: Request App A with code
    A->>S: Exchange code for tokens and fetch permissions
    S-->>A: accessToken + refreshToken + permissions
    A-->>B: 302 back to the original URL, App A signed in

    Note over B,X: 2) Single sign-on: App B needs no credentials
    B->>X: Access a protected resource of App B
    X-->>B: 302 to /sso/login?clientId=B
    B->>S: GET /sso/login
    S-->>B: TGT exists, redirect back to redirectUri?code=.. directly
    B->>X: Request App B with code
    X->>S: Exchange code for tokens and fetch permissions
    S-->>X: accessToken + refreshToken + permissions
    X-->>B: 302 back to the original URL, App B signed in silently

Why App B needs no credentials: the browser carries the TGC cookie of the SSO domain, so the server recognises the existing global session (TGT) and issues an authorization code directly. Logout and renewal sequences: docs/architecture.en.md.

  • Protocol: OAuth 2.0 authorization code. The server keeps a global session (TGT, cookie name TGC); clients validate their own accessToken locally and use the refreshToken for renewal.
  • Two-step validation: the user's identity is validated when issuing the authorization code, and the client's identity (ClientId/ClientSecret) when exchanging it for an access token — an application can never obtain another application's resource permissions.
  • Same-origin by default: when smart.sso.server-url is left empty and the application is the SSO server, everything is same-origin — browser redirects use relative paths and server-to-server calls use a derived loopback address. A standalone client that forgets to configure it fails fast at startup instead of silently redirecting to itself.
  • Permission model: sso_permission.code stores stable business permission codes such as user:read and user:write; menu entries use type=menu and keep their navigation URL in sso_permission.url, while endpoint authorization uses type=function. Controllers in the smart.sso.url-patterns scope require login by default; methods annotated with @RequiresPermission("...") additionally require the corresponding function permission. Unannotated methods remain available to logged-in users, and paths outside the scope (or in exclude-urls) bypass SSO.

Full protocol sequence, credential model and distributed setup: docs/architecture.en.md.

Modules

smart-sso
├── smart-sso-server    -- authentication &amp; authorization center + permission console (also a client of itself)
├── smart-sso-demo      -- client example (token via request header)
├── smart-sso-starter   -- auto-configuration modules (individually consumable)
│   ├── smart-sso-starter-base              -- shared constants, utilities, credential cleanup
│   ├── smart-sso-starter-client            -- client-side token lifecycle management
│   ├── smart-sso-starter-client-redis      -- Redis support for the client
│   ├── smart-sso-starter-server            -- server-side credential lifecycle management
│   └── smart-sso-starter-server-redis      -- Redis support for the server
└── verify/             -- functional verification suite (API + browser end-to-end)
Branch Stack Notes
master Spring Boot 3.5.x + JDK 17 Current line, version 2.1.x
1.7 Spring Boot 2.x + JDK 8 Legacy maintenance branch

Tech Stack

Technology Version Purpose
spring-boot 3.5.9 Container + MVC
smart-stage 2.0.3 Base layer (Result/Page, MyBatis-Plus wiring)
mybatis-plus 3.5.12 ORM (managed by smart-stage)
H2 2.3.232 Embedded in-memory database for the zero-dependency mode
mysql-connector-j 9.5.0 Production JDBC driver (managed by Spring Boot)
spring-boot-starter-data-redis 3.5.9 Shared credentials for distributed deployments
httpclient 4.5.14 Authorization-code exchange between client and server
Front-end static SPA Ace Admin + jQuery + zTree (no template engine)

Configuration Cheat Sheet

Property Default Description
smart.sso.server-url empty Authentication center URL; empty = same-origin (only when this app is also the server)
smart.sso.client-id / client-secret — Client credentials, issued by the server
smart.sso.exclude-urls — Paths bypassing login; a trailing /* means prefix match
smart.sso.server.timeout 7200 Global session (TGT) timeout, seconds
smart.sso.server.access-token-timeout 1800 Access token timeout, seconds
mybatis-plus.global-config.db-config.table-prefix sso_ Table name prefix
spring.profiles.active dev dev = H2 in-memory, prod = MySQL

Full reference: docs/configuration.en.md.

Documentation

Guide English 中文
Why OAuth 2.0 English 中文
Client integration English 中文
Architecture and protocol English 中文
Configuration reference English 中文
Frequently asked questions English 中文
Development and verification English 中文

Screenshots

Sign-in page Console home
Sign-in Home
Organization management Organization editor (parent pre-selected)
Organizations Organization editor
User management (organization tree) Role authorization (granted permissions pre-checked)
Users Role authorization
Permission management Application management
Permissions Applications
Role management Session management
Roles Session management

Build & Verification

# Build (works offline once the local repository is populated)
mvn -o -DskipTests clean package

# Server-side suite: build + start dev/H2 + protocol/security/API/CRUD assertions (exit code is the result)
verify/verify.sh

# Front-end suite: real browser (local Chrome) end-to-end
cd verify/e2e && npm install && BASE=http://127.0.0.1:8080 node front.mjs

Coverage: startup and profile wiring, the SSO protocol main path, unauthenticated/unauthorized branches, all read-only APIs, CRUD plus cascade deletion across the five admin modules, and browser-level rendering/interaction assertions. Currently 68 server-side assertions + 37 browser assertions pass. See docs/development.en.md.

Contributing

Issues and pull requests are welcome. Please read docs/development.en.md first, and run verify/verify.sh locally before submitting — the protocol and business cases should all pass.

Community

QQ groups: 454343484, 769134727

Email: 466350665@qq.com

License

MIT © 2020 Joe

Frequently asked questions

Is smart-sso free to use?

smart-sso is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does smart-sso do?

SpringBoot single sign-on authentication and authorization, implemented with OAuth 2.0, supporting cross-domain and distributed deployment.

What is smart-sso written in?

smart-sso is primarily written in Java. Its source is publicly available at https://github.com/a466350665/smart-sso, and it has 2,300 GitHub stars.