RE: GAEAuthenticator and Android - anyone make this work?

2012-05-21 Thread Richard Berger
Some success - at least when accessing a local GAE server.  

#1. Replaced use of the Android Account Manager with at HttpClient call to 
http://10.0.2.2:/_ah/login to obtain the authentication information 
(dev_appserver_login=l:True:145185941422614610318; Path=/;)

This was followed by creating a restlet cookie and putting it into the 
ClientResource (which I had already been doing before):
org.restlet.data.Cookie securityCookie = new org.restlet.data.Cookie(0, 
authTokenName, authToken);
commitsClient.getRequest().getCookies().clear();
commitsClient.getRequest().getCookies().add(securityCookie);

#2. When looking at the error I had always been getting (Communication Error 
(1001) - The connector failed to complete communication with the server.), I 
found deeper in the log System.err(677): java.net.SocketException: Bad address 
family and I remembered reading the documentation sayig that it may be 
necessary to do:
System.setProperty(java.net.preferIPv6Addresses, false);

Then things started working locally.

Next up is figuring out how to:
a) Use the AccountManager (I need to turn the AuthToken for my account into the 
right cookie)
b) Make this work with my real GAE account.

Will post back with either a solution or a white flag of surrender.

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2963883


RE: GAEAuthenticator and Android - anyone make this work?

2012-05-21 Thread Richard Berger
Following Nick's excellent blog article at: 
http://blog.notdot.net/2010/05/Authenticating-against-App-Engine-from-an-Android-app
and with the changes I had made previously, I am now able to use the Android 
AccountManager and Restlet's GaeAuthenticator to require authentication to 
access the API uris.  

Now time to throw it away and replace it with oAuth2 :).

RB

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2964176