.NET MAUI › Security & Authentication
How do you store authentication tokens securely in MAUI?
BeginnerAnswer
Use SecureStorage, which encrypts values with the platform keystore/keychain, for tokens and secrets. Never keep them in Preferences (plain) or in source. Clear tokens on logout with SecureStorage.Default.Remove or RemoveAll.
await SecureStorage.Default.SetAsync("refresh_token", token);
SecureStorage.Default.Remove("refresh_token"); // on logoutReal-world example After sign-in the refresh token lives in the OS keychain and is wiped on logout.