I have a specific google account and a file on it. I want to modify the file from a few android devices without having to log in to this account (User don't have a permission to use this account). I also don't want user to access this file manually (only with the app), so the file can't be shared.
I don't want to share login and password, because it's not safe. I came with idea to share encrypted token, but it expires really fast, so i wanted to share an encrypted refresh token, but when I want to obtain it, problems appear.
I have an android.accounts.Account
object and I probably should be able to get refresh token with android.accounts.AccountManager
, like this:
String refreshToken = accountManager.getUserData(account, "refreshToken");
but I can't do it, because of this:
java.lang.SecurityException: uid cannot get user data for accounts of type: com.google
Is it a good idea to share refresh token? How can I get it? If not, how to do it?