0

On xamarin app, where I can store my dbConnection or other security-sensitive data. For example in asp net application my DBConnection string i store in the appsettings.json file, and a user don't have access to that file. But on xamarin app I don't found secure way, For example, I can hardcode dbConnection in my code, but the user can decompile my code and get dbConnection string

Dark
  • 1
  • 1
  • 1
  • check please https://stackoverflow.com/questions/69199278/manage-user-secrets-in-a-custom-config-file – Amjad S. Mar 07 '22 at 13:06

1 Answers1

-1

You can use SecureStorage from Xamarin Essentials to store sensitive data.

await SecureStorage.SetAsync("oauth_token", "secret-oauth-token-value");

Check documentation for Xamarin Essentials https://learn.microsoft.com/en-us/xamarin/essentials/secure-storage?tabs=ios

benyaala92
  • 58
  • 5
  • 1
    But if i will use this code await Secure Storage.SetAsync("oauth token", "secret-oauth-token-value"); the user can open my application on decompiler, an see the secret-oauth-token-value – Dark Mar 07 '22 at 12:07
  • dont hard code it. You can generate a GUID the store the value. – benyaala92 Mar 07 '22 at 12:14