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
I made learner tokens device-bound, with a device id claim in the token.
I added per-platform DRM levels, so a school can require stronger devices on some platforms.
I built a security-context API that the licence server calls to get the user and device details.
I added token refresh, so learners do not have to log in again every day.
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
