Authentication architecture · 2026 – present

Auth layer

The authentication and authorisation layer above an external identity provider: web, mobile and machine access in one model.

Back to all projects
Role
Sole developer & architect
Timeframe
2026 – present
Context
Designed and built from scratch on my own
Technologies
NestJSTypeScriptNode.jsPostgreSQLSequelizeOIDC / SSOJWTDockerPM2Bitbucket Pipelines

A shared authentication and authorisation layer for the whole product ecosystem. It connects browser, mobile app and service-to-service access through one model for organisations, roles, modules and seats. I designed and built the platform as the sole developer in around four months across 124 commits.

01

Context

The existing products had grown over years. Each product verified sign-ins and partly managed roles and project grants itself — with different rules for web, mobile and machine communication.

The identity provider stayed in place. The new layer was to unify the level above it — organisations, roles, modules and seats — and make revocation possible in one place.

02

My contribution

  • Three access paths behind one shared authorisation layer: web, mobile app and service-to-service.
  • Sign-in through the external identity provider with OIDC; sessions are held server-side.
  • Permissions are checked centrally, not only in the frontend.
  • Responsibilities are clearly separated: the identity provider knows users, the auth layer knows organisations, roles and seats.
03

Architecture & delivery

  • NestJS and TypeScript with shared libraries.
  • The external identity provider remains responsible for OIDC, SSO and user management; the auth layer owns the organisation, role, module and seat level above it.
  • PostgreSQL for organisations, roles, modules and seats; migrations run before the containers start.
  • Docker and blue-green deployment; the products share the same authorisation logic. Correctness comes from clear ownership and idempotent flows.
System design Three access paths, one authorisation layer
Clients
Trust boundary
Identity & data
Vue Web
Flutter App
Services
Web service OIDC
Mobile service device session
Service gateway service identity
Authorisation roles · permissions
Tenant & seats roles · modules · quotas
Identity provider OIDC · SSO
PostgreSQL roles · seats
Products verified identity
Identity Identity

Web, mobile and service-to-service access share one authorisation layer and the same role and seat context.

Design decisions
  • Three access paths share one authorisation layer.
  • Sign-in through an external identity provider; sessions are held server-side.
  • Permissions are checked centrally, not only in the frontend.
  • The identity provider knows users; the auth layer knows organisations, roles and seats.

Scroll horizontally to see the full design.

04

The hard parts

01

Three clients, three requirements

A browser needs a different kind of sign-in than a mobile app or a server. The architecture makes those differences explicit instead of forcing one token for everything.

02

Carrying existing sessions along

The change could not pull users out of their daily work. Existing sign-ins had to be carried over and kept working during the rollout.

03

Role changes that arrive

Roles and seats are re-evaluated on every check, not only at sign-in. Changes take effect immediately, including during ongoing use.

05

Outcome

  • One central layer for organisations, roles, modules and seats.
  • Web, mobile and M2M share the same authorisation logic.
  • MyEvoSys and Intervento are connected; integration of the remaining products is in progress.
  • The architecture is documented and traceable in the repository.

Contact

Let's talk about the next role.

I am looking for a position where I can take responsibility for systems and teams as a lead engineer or software architect. Ideally where reliability, data and real-world workflows meet.

Send an email [email protected]

Availability

Region
Thun/Bern
Workload
80%
Work location
On-site, hybrid or remote by arrangement
Travel
Generally yes, scope depending on the role and responsibilities
Start
by agreement