Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share login data between two android apps with same credentials

Problem:

I have two Android apps, which use the same login data. The product owners want to enable seamless login between those two apps, meaning that the user should only login into one app and then login into the second app without entering the credentials.

Research possible options:

I read a lot, but I haven't found a solution yet. One option was to add a sharedUserId to the manifest, but it is said that this only works if no app his been published yet, else the user will no longer have access to his old saved data. As this is the case with one of my apps, this option has been eliminated.

Else I read about AccountManager, which is also suggested in this reddit post, but there are also concerns mentioned, that one should not save a password in the account manager. My apps don't have a token for further authentication, only a password, so I'm not sure if AccountManager is a good choice.

Also I heard that there is the KeyChain Api for system-wide credentials, but I'm not sure yet where the difference is between AccountManager and KeyChain

The newest one I found is Smart Lock, but from the documentation I didn't find out if there is a way to share credentials between apps and not between apps and websites, also as this is a password for a physical device, this is not an option for the product owners to see a Google message indicating that this password is saved somewhere in the cloud.

Question:

After looking into all these possibilities, I still don't know which option would fit my case best. What could be a good choice for saving credentials in my case?

like image 239
Eve Avatar asked Nov 09 '22 05:11

Eve


1 Answers

You could implement a Content Provider in which you would be handling entries and updating login status.

You have these possibilities:

User logins App A -> Update Schema X -> Enters app B -> Check Schema -> if field says App A is logged, proceed.

User logins App B -> Update Schema X -> Enters app B -> Check Schema -> if field says App B is logged, proceed.

You have to be aware that logout options could be troubling if you are working online.

Good luck :)

like image 176
Tiago Dávila Avatar answered Dec 08 '22 16:12

Tiago Dávila