What is the most appropriate way to store user settings in Android application

后端 未结 14 2289
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 05:38

I am creating an application which connects to the server using username/password and I would like to enable the option \"Save password\" so the user wouldn\'t have to type

14条回答
  •  温柔的废话
    2020-11-22 06:20

    I'll throw my hat into the ring just to talk about securing passwords in general on Android. On Android, the device binary should be considered compromised - this is the same for any end application which is in direct user control. Conceptually, a hacker could use the necessary access to the binary to decompile it and root out your encrypted passwords and etc.

    As such there's two suggestions I'd like to throw out there if security is a major concern for you:

    1) Don't store the actual password. Store a granted access token and use the access token and the signature of the phone to authenticate the session server-side. The benefit to this is that you can make the token have a limited duration, you're not compromising the original password and you have a good signature that you can use to correlate to traffic later (to for instance check for intrusion attempts and invalidate the token rendering it useless).

    2) Utilize 2 factor authentication. This may be more annoying and intrusive but for some compliance situations unavoidable.

提交回复
热议问题