03 / Identity
Revoking a stolen phone's tokens
Built device-level token revocation across 4 repositories so support can invalidate everything issued to a stolen device.
01The problem
When a user's phone was stolen and support deleted the device, tokens already issued to it still worked. An attacker could keep reading health data. Insurers required immediate invalidation of everything issued to that device: ID, access and refresh tokens, including tokens obtained by token exchange.

02What I did
- Designed and built the flow end to end across 4 repositories.
- New AuthStates that bind tokens to a device at issuance and revoke a device's refresh tokens.
- A REST service in the ID-broker authentication layer, and a new authenticated revoke-by-device endpoint in the Spring Boot entry gateway.
- Secrets and configuration wiring, plus role-based authorization for the calling clients.
- Integration tests for the positive, negative and unauthorized paths. Later diagnosed tester-reported failures: a wrong token and certificate issues on the test stage.
03Result
- Code complete and reviewed. The pull requests are ready to merge and scheduled with the consolidated token revocation release. The integration suite is merged.