This whole Auth 2.0 thing is a total mess. Did you test it on Android 2.0.1
devices? It didn't crash for you there? Can you support hosted accounts?

I think I will give up on this until Google documents how to use their
implementation (the Google one, not the Android framework). There is just
already too much time sunk here.

Anyway, regarding your actual issue, did the Auth mechanism ask you twice to
allow access to the selected account? I am not quite sure how it determines
the caller, but maybe it might not be the calling app, but the certificate
it was signed with that makes the difference. Did you use the same
certificate to sign both apps?

On Thu, Mar 4, 2010 at 9:35 PM, ubikdroid <markst3v...@googlemail.com>wrote:

> I think I might have found an issue with using AccountManager in
> Android 2.x devices. I have 2 apps in the market that use Google
> Reader: Reader Widget Pro and Reader Widget Free. I was updating them
> both to use AccountManager and the new authentication method. I
> noticed that on my Nexus One when one application (say the Free one)
> obtained a token using AccountManager.getAuthToken() with the service
> set to "reader" the other app (say the Pro one) was unable to obtain a
> token afterwards. Even using AccountManager.invalidateAuthToken() in
> the first app did not work. Sample code:
>
> AccountManagerFuture<Bundle> accFut =
> accountManager.getAuthToken(acct, "reader", false, null, null);
> try {
>        if(accFut != null && accFut.getResult() != null){
>                Bundle bundle = accFut.getResult();
>                authToken = bundle.getString("authtoken"); // This key is no
> longer
> in the bundle for the 2nd app
>                Log.e(TAG, "accFut null");
>        }
> } catch (OperationCanceledException e) {
>        e.printStackTrace();
> } catch (AuthenticatorException e) {
>        e.printStackTrace();
> } catch (IOException e) {
>        e.printStackTrace();
> }
>
> I don't know if this is supposed to happen. It could mean big problems
> if several apps are trying to get auth tokens for the same service on
> the same phone. One application could prevent others from working. I
> will stick to the old GoogleLoginServiceBlockingHelper method in my
> apps for now. Anyone else noticed this issue?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to