CodeName OneShai Almog8 min readintermediate
App Shield: Your Server Should Not Trust the App Calling It
Summary
App Shield moves device‑integrity checks from the client to the server by obtaining a short‑lived ES256 attestation token from Apple App Attest or Google Play Integrity, verified by Codename One’s service, and required by the backend for protected API calls.
- Attestation token is bound to a nonce, package, platform, and optionally request body, preventing replay.
- Server‑side verification replaces insecure client‑side booleans; compromised apps cannot forge valid tokens.
- Integration is a one‑line enable flag plus host‑policy configuration; App Shield automatically guards Codename One’s NetworkManager requests.
- Two host policies: ENFORCED (block request if no token) and PROTECTED (allow request but mark it unverified).
Shifting trust to the server mitigates the classic mobile threat where attackers patch client checks. By using hardware‑backed attestation and short‑lived signed tokens, the backend receives cryptographically verifiable evidence of app integrity, raising the cost of abuse for high‑value operations…
6/10