Xamarin Security-Sensitive data storing

826 Views Asked by At

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

1

There are 1 best solutions below

2
On

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