What are key security best practices for a production MAUI app?
Short answer
Store secrets in SecureStorage, never in code or Preferences; use HTTPS everywhere (optionally pinning); enable trimming/obfuscation to raise the bar on reverse engineering; validate all input; keep tokens short-lived with refresh; request minimal permissions; and encrypt…
Advertisement
AModel answer
Store secrets in SecureStorage, never in code or Preferences; use HTTPS everywhere (optionally pinning); enable trimming/obfuscation to raise the bar on reverse engineering; validate all input; keep tokens short-lived with refresh; request minimal permissions; and encrypt sensitive local data (SQLCipher). Assume the client is untrusted—enforce authorization on the server.
// Enforce transport security and minimal token lifetime server-side;
// client stores only short-lived tokens in SecureStorage.Real-world example
A security review confirms no secrets ship in the binary and that the server, not the app, enforces authorization.
Likely follow-ups
- Why treat the client as untrusted? | How does trimming help security?
Related topics