I've created a library where all the authentication is configured, including AccountManager's authenticator class. This library is intended to be used by different apps and with different signing certificates.
The scenario is the following: Two apps importing installed in the device both importing the library. I'm adding an account to the AccounManager from one of them, and then calling AccountManager's peekAuthToken() from both. It works for api < 22 (it is indicated in the docs) but returning a SecurityException in lower APIs (which is expected).
What would be the way to accomplish that in lower versions?
I have also try to use getToken instead, which returns a Future object, but the future.getResult() seems to fail at some point (no kind of exception is shown) and never returns the result with api <=22 and different signing certificates.
Any clue?
It can be solved adding the following att to the authenticator.xml configuration file: android:customTokens="true"
It will look as:
I'm not sure what is happening internally with this att enabled.