1

I have two apps. The use case is:

  • If I open app A and I login, I get a custom token. I want to store it somehow in the KeyStore so if I open app B the token is there and I do not have to login again.

I've been reading about using the KeyStore to achieve this but I wasn't able to find a good working example or tutorial doing something similar.

This is easily achievable in iOS using the keyChain. But what about Android?

Only my apps should be able to get this token. Is there any info on how to store safely this info and share it between my apps? (using a backend server is not an option)

A working example would be great as a reference.

Thanks in advance.

nathan
  • 9,329
  • 4
  • 37
  • 51
Victor
  • 206
  • 2
  • 10
  • Android KeyChain can store system wide credentials, but they must be digital certificates, not tokens. The user is prompted to authorize usage for your application or any other – pedrofb Aug 01 '17 at 17:55
  • Hi @pedrofb, thanks for your response. What do you suggest for this use case then? – Victor Aug 01 '17 at 18:46
  • I do not see simple way to share token. Or use electronic certificates, or perhaps a centralized application "Authenticator", which can be invoked by the rest when they need an access token. – pedrofb Aug 02 '17 at 05:55
  • With electronic certificates, do you mean the key store? – Victor Aug 02 '17 at 08:41
  • No, I meant to use the android keychain as i commented above – pedrofb Aug 02 '17 at 09:58
  • "but they must be digital certificates, not tokens. The user is prompted to authorize usage for your application or any other " so not a valid solution. – Victor Aug 02 '17 at 10:20
  • 1
    Yes, it would mean changing the bussiness logic. The other alternative to share data among your applications could be implemented using a ContentProvider or using `SharedPreferences` and the same `sharedUserId` (when all applications are signed with the same certificate). See https://stackoverflow.com/questions/5745243/data-sharing-between-two-applications – pedrofb Aug 02 '17 at 11:09

0 Answers0