Service Licensing System
Token activation, permission management, and admin CRUDs
The product needed to control access to features by license plan, with self-service activation and centralized admin management.
- 01Modeling granular permissions per feature without exploding schema complexity
- 02Token activation flow with expiration and single-use invalidation
- 03Admin panel with complete CRUDs without a pre-made admin framework
Single-use activation tokens
Tokens generated at sale, hashed in the database, valid for N days. After use, marked as consumed. Prevents reuse and is easy to audit.
Bit-flag permissions instead of junction table
Permission count is fixed and small (<64). Bit-flag simplifies verification queries and reduces joins.
Bit-flag makes adding new permissions more rigid. Accepted given that the feature set is stable and small.
.NET 8 + EF Core + PostgreSQL. Tokens with SHA-256 + salt hash. JWT for authenticated sessions with permission claims. REST controllers with policy-based authorization.
Licensing system with token activation, granular permission control, and complete admin panel.
- ›Never store tokens in plain text — even activation tokens must be hashed
- ›Audit log in a separate table for each permission mutation is essential for support