Sena is a plug-and-play authentication and access-management framework for Spring Boot RESTful services — part of the MetheaX project. Drop it in, configure a keystore, and ship.
Sena handles the full auth lifecycle out of the box, so your team can focus on business logic.
Encrypted access and refresh tokens via Nimbus JOSE+JWT using RSA-OAEP-256 + A256GCM.
Modern, memory-hard password encoding that resists GPU and side-channel attacks.
2048-bit RSA keys loaded from PKCS12 keystores. Separate keys for access and refresh tokens.
Fine-grained URI permission control — bind roles to resources with a simple database model.
Selectively expose endpoints without authentication. Configure per HTTP method.
Server-side session tracking with full token revocation support per user or session.
Automatic createdBy / updatedBy population integrated with Spring Security context.
Add one Maven dependency, configure component scan and keystores — no boilerplate auth code required.
Sena is split into focused modules. Depend only on what you need.
Domain entities, repositories, security primitives, JPA configuration, utilities, and keystore services.
Authentication REST API — token issuance, refresh, and revocation, plus the Spring Security filter chain.
Runnable sample host application demonstrating a complete Sena integration with a minimal Spring Boot setup.
All endpoints are mounted under /auth/** and are publicly accessible by default.
| Method | Path | Description |
|---|---|---|
| POST | /auth/token | Obtain a new access token + refresh token pair |
| POST | /auth/refresh/token | Exchange a valid refresh token for a new access token |
| POST | /auth/token/revoke | Revoke an active access token (invalidates the session) |
// POST /auth/token { "username": "admin", "password": "secret" }
{
"status": 200,
"message": "Access token generated!!!",
"token": {
"accessToken": "<JWE>",
"refreshToken": "<JWE>",
"tokenType": "Bearer ",
"expiredIn": "1234567890"
}
}
# Pass the access token in all subsequent requests
Authorization: Bearer <JWE>
All entities live in the sena-core module and are auto-wired via Spring Data JPA.
Prerequisites: JDK 21+, Maven 3.8+, PostgreSQL.
Insert a default admin account, group, user, role, resource, and permission. Default credentials: admin / admin (change immediately in production).
JaCoCo enforces a minimum 85% instruction coverage gate on every build.