http - Android ClientLogin Authentication - HTTPURLConnect -


i have implemented httpoperations class in android can produce http post request. class extends asynctask can run in background.

this used create http request authenticates google blogger service using clientlogin method (detailed here: http://code.google.com/apis/accounts/docs/authforinstalledapps.html )

recently have run issues getting filenotfoundexception if enter correct credentials. i'm puzzled few days ago working fine correct credentials , returning filenotfoundexception when entered wrong credentials.

my questions be:

  • why returning filenotfoundexception when post incorrect credentials - why not return string stating error=badauthentication when access via browser? https://www.google.com/accounts/clientlogin

  • why experiencing issues correct credentials? may worth noting http post correct, know because if post http version of clientlogin rather https one, http 302 moved temporarily error page.

my httpoperations class built using httpurlconnection class in java, set headers , method of httpurlconnection accordingly , open dataoutputstream write post request, open inputstream retrieve response. exception caught if credentials incorrect (and if correct).

i must stress using different method of authentication not useful solution, unfortunately must continue using clientlogin. extremely difficult trace in packages wireshark due call being made on https.

if code, etc, please let me know.

i call class (which singleton) using:

asynctask<string,void,string> requestresult = httpop.execute("post","https://www.google.com/accounts/clientlogin",postdata,"true",""); 

a few notes:

  1. clientlogin legacy api , being replaced other protocols (oauth). google says:

    authsub , clientlogin google's proprietary authorization apis, available alternative oauth google apis. if possible, should avoid using these services 
  2. there warning clientlogin might not work google accounts.

  3. instead of rolling own, there google api client library java, recommended way access google apis.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -