Skip to content
IH
Back to work

Backend Engineering · Security · Architecture

Identity & Access Platform

A structured authentication and authorisation platform designed for enterprise applications and future multi-channel access.

Role
Backend architecture and engineering
Timeline
2024 — 2025
Stack
JavaSpring SecuritySpring ModulithPostgreSQLRedisAWS
InterfaceIdentityCatalogueOrdersPostgreSQL · RedisAWS · Terraform · Containers
Overview

Context, challenge and the part I played.

Context

Identity is usually bolted onto an application late, then becomes the hardest thing to change. This platform treats it as its own product from the start.

Challenge

Different consumers need different things from identity — a browser wants a session, a mobile client wants a token, an internal service wants a scoped credential. One implementation had to serve all three without special cases leaking everywhere.

Goals

  • Model authentication as a sequence of steps, not a single call
  • Keep authorisation decisions in one place
  • Make every security-relevant change auditable
  • Support additional factors and channels without redesign

My role

I designed the module structure, the domain model and the security workflows, and implemented the platform end to end.

Approach

From interface down to infrastructure.

Each layer, and the reasoning that shaped it.

Architecture

Spring Modulith enforces the boundary between identity and everything else at build time. Other modules depend on a small published interface; the internals — credential storage, session handling, factor verification — are not reachable from outside.

Front-end

No user interface of its own. The platform exposes documented endpoints and a reference flow, so each consuming application can present login in its own visual language.

Backend

Java with Spring Security. Login is a state machine: identify, verify, elevate, establish. Each transition is explicit, which is what makes adding a second factor a new state rather than a new branch inside an existing method.

Database

PostgreSQL for accounts, roles and audit records. Credentials are stored with a modern password hash and never logged, and audit rows are append-only.

Cloud & deployment

Redis for session storage so application instances hold no state. Deployment mirrors the platform it serves, which keeps environments consistent.

Capabilities

What the system actually does.

  • Session-based web authentication

    Server-held sessions with immediate revocation and no sensitive claims on the client.

  • Role and permission management

    Permissions are checked at the service boundary, not scattered through controllers.

  • Multi-factor authentication readiness

    The login flow is modelled as steps, so a second factor slots in without a rewrite.

  • Modular architecture

    Identity is a self-contained module with a published interface for the rest of the platform.

  • Audit-friendly security workflows

    Every credential and permission change emits a structured event with actor and reason.

  • Scalable session management

    Redis-backed sessions so instances stay stateless and can be replaced freely.

Gallery

Interface and system views.

Placeholder frames — swap for real captures once they exist.

  • InterfaceIdentityCatalogueOrdersPostgreSQL · RedisAWS · Terraform · Containers
    Authentication state machine
  • admin · orders
    Role and permission administration
  • iroshahewage.dev/preview
    Reference sign-in flow
Decisions

The trade-offs worth writing down.

Every architecture is a set of choices. These are the ones that mattered most, and why they went the way they did.

Login as a state machine

Treating sign-in as one method means every new requirement becomes another conditional. Modelling it as states made multi-factor readiness a matter of inserting a step, and made the flow explainable to non-engineers on a whiteboard.

Authorisation at the boundary

Permission checks placed in controllers get missed. Enforcing them where a module's interface is called means a new caller cannot forget the check, because there is nowhere else to enter.

Append-only audit records

Security history that can be edited is not history. Audit rows are written once and never updated, which keeps the trail useful during an investigation.

Outcome

Where it stands.

  • Supported secure and structured platform development
  • Improved separation of responsibilities between identity and business logic
  • Designed for future multi-channel and multi-factor access
  • Created a maintainable foundation other applications can adopt

Want the detail behind any of these decisions?

Start a conversation