Single Sign-On
Built an SSO platform from scratch with Next.js and Fastify in TypeScript, covering application registration, RBAC, and token management.
- Role
- Full-stack Engineer
- Company
- PT. Spasi Indonesia
- Status
- Internal
- Stack
- Next.js
- Fastify
- TypeScript
- PostgreSQL
- Swagger
- Scalar

Visual representation created for the portfolio; production interfaces and internal details are intentionally omitted.
The problem
Give internal applications shared sign-in, configurable redirect destinations, and role-based access control.
What changed
Registered applications share authentication and access controls, with a documented flow to exchange redirect tokens for application JWTs.
Context
Internal applications needed a shared authentication platform that could register applications, configure where users return after sign-in, and manage access both within SSO and for each registered application.
Engineering decisions
Built the project from scratch across a Next.js frontend and Fastify backend, both written in TypeScript. Implemented application registration and redirect configuration, internal SSO RBAC, RBAC for registered applications, and token issuance, management, flushing, and revocation. Prepared Swagger/Scalar API documentation for application integration: each registered application stores its application token and uses it to exchange a redirect token for a JWT used by the destination application.
My contribution
- Built the Next.js frontend and Fastify backend from scratch in TypeScript.
- Implemented application registration and redirect destination configuration.
- Implemented role-based access control within SSO and for registered applications.
- Implemented token issuance, management, flushing, and revocation; maintained signing-key handling, sessions, and shared identity validation.
- Documented integration with Swagger/Scalar: registered applications store an application token to exchange redirect tokens for destination-application JWTs.
Next project
Questions about this work?
Ask the assistant, or email me directly.