How to save a token secretly in Android

寵の児 提交于 2021-02-11 12:25:10

问题


I have an Android app where users have to login to use it, when a request is made (in PHP) a token is needed, the thing is, I need to save the token in Android's shared preferences, I know there are ways to encrypt it, but if someone would go to open the app and see the source code, the would know how it was encrypted.

How do I securely save the token?

Thanks in advance.


回答1:


Android Keystore is a preferred way of storing sensitive information, namely token, password, etc.

However, in case you want to simply store it in SharedPrefs, using one of the existing libraries would come in handy. You can check SecureStorage library and give it a try.



来源:https://stackoverflow.com/questions/57402457/how-to-save-a-token-secretly-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!