Skip to content
Keshav Raj
A phone with a fingerprint chip issuing a token that fits only that phone, with shield tiers.
SECURITY QUARTERPER DEVICE
SHIPPED Device-bound JWTs, per-platform DRM levels and a security-context API.I OWNED Primary engineerOUTCOME PER DEVICE

Device-bound licence tokens

Keshav RajPrimary engineer · 2026 · ShippedContact meResume PDF

Context

The ed-tech company's anti-piracy system needs to know which device is asking for a video licence. I built the server side of that, as the primary engineer, in 2026.

The problem

The licence server needed to know which device was asking, and how secure that device was, before handing out a licence.

What I did

  1. I made learner tokens device-bound, with a device id claim in the token.

  2. I added per-platform DRM levels, so a school can require stronger devices on some platforms.

  3. I built a security-context API that the licence server calls to get the user and device details.

  4. I added token refresh, so learners do not have to log in again every day.

  5. I added admin APIs for course protection settings, an allow list, DRM credentials and a school-wide piracy KPI. It was six stacked pull requests.

Key decision

I bound tokens to devices, with a device id claim in the token, instead of relying on the token alone.

The cost is more care for real users who change phones, so token refresh and an allow list were part of the design.

Result

Licence tokens are now tied to a device, with per-platform levels and a security-context API behind them. I do not have a measured outcome figure for this work.

What I learned

Token lifetime mattered. On the licence server I also cut a token lifetime of about 1000 hours down to 72 hours in the hardening work.

Stack

  • Rails
  • GraphQL
  • JWT
  • Fastify
Play the world →