On Mon, Jul 30, 2012 at 2:32 PM, JP <[email protected]> wrote:
> I am trying to authenticate with the Gmail atom feed using the
> authentication token of the Gmail account, obtained from AccountManager.
>
> I have no problem pulling the authentication token for a Google Account
> registered on the device, using AccountManagergetAuthToken() with the
> authTokenType "mail", but the authentication token does not register with
> the atom feed. I've played with a few variations, but all I get is a 401 /
> Unauthorized response from Google.
> Basically, I've tried to GET https://mail.google.com/mail/feed/atom/unread
> adding in a "Authorization" header item with "Bearer <authentication
> token>", but that didn't work.

Unless there is an official API, this may or may not work.

What you are getting from AccountManager is a ClientLogin token, but
you are trying to use is as if it were an OAuth token, that's probably
why you get an error. For ClientLogin you need something like:

Authorization: GoogleLogin auth=token

Again, this may or may not work, especially since ClientLogin is deprecated.
I am also not sure whether the 'mail' token will work for the RSS feed.

To get an OAuth token, you need to use 'oauth2:scope' where scope
is the scope for the particular service, you need to find out what it is
for this feed.

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

Reply via email to