Monday, 15 March 2010

oauth 2.0 - Access to Gmail Atom feed with OAuth2 from Android app stopped working -



oauth 2.0 - Access to Gmail Atom feed with OAuth2 from Android app stopped working -

i have android app, access gmail atom inbox feed read-only access unread emails (that's need). and, stopped working.

it using oauth2 , googleauthutil. how works, utilize of asynctask in service:

first, token:

string scope = "oauth2:https://mail.google.com/mail/feed/atom/"; token = googleauthutil.gettoken(context, accountname ,scope );

then utilize read feed:

httpurlconnection connection = (httpurlconnection) new url(urlstring).openconnection(); connection.addrequestproperty("authorization", "bearer " + token); connection.connect(); //get insputstream, read it, etc.

problem this working approx. 1 month (may/june 2014). app published on googleplay , has users. it working , tested on different devices, different accounts, etc. i'm not 100% sure stopped working on installations, can not work myself , devices. app accessed feed approx. every 10-20 minutes (based on user setting).

do have thought why happend?

since few days, can still obtain token, response unauthorized (401) response:

<html> <head><title>unauthorized</title></head> <body bgcolor="#ffffff" text="#000000"> <h1>unauthorized</h1><h2>error 401</h2> </body> </html> i tried: to invalidate token every time to fiddle scope to rewoke access in accounts settings to reinstall to update google-play-services library

etc., no result.

after research, know client-id needs generated access various google apis. able generated such id.

i tried utilize id - include in scope , run app signed apk. but cannot find api in list (https://console.developers.google.com) gmail or atom feed, or related gmail. unable utilize it.

any help appreciated.

edit - solved google resolved issue, updated :-) - works again.

android oauth-2.0 gmail atom

No comments:

Post a Comment