I am using sign-up/sign-in with Google feature in my app, but when I deploy 
the my app in google app engine then I am getting following error.

org.apache.http.impl.client.DefaultRequestDirector tryConnect: I/O 
exception (java.net.SocketException) caught when connecting to the target 
host: Permission denied: Attempt to access a blocked recipient without 
permission. (mapped-IPv4)

Below is my implementation.

   1. Redirect the user to https://accounts.google.com/o/oauth2/auth and 
   get the code
   2. 
   
   After getting the code from step 1, make a request from backend to
   https://accounts.google.com/o/oauth2/token for authorization 
   code/access_token *(this is where I am getting the error in App Engine)* 
Following 
   are the request params I am sending
   
   List<NameValuePair> httpParams = new ArrayList<NameValuePair>(); 
   httpParams.add(new BasicNameValuePair("code", <code_from_step1>)); 
   httpParams.add(new BasicNameValuePair("client_secret",<my_client_secret>)); 
   httpParams.add(new BasicNameValuePair("grant_type","authorization_code"));
   3. 
   
   After getting the access_token from step 2 get the user info from 
   www.googleapis.com/plus/v1/people/me
   
While the same flow is working fine on local machine or any other remote 
machine. Can anyone tell me how to fix this issue?

I have also tried by adding API_KEY to the request header, still i gets the 
same problem.

requestHeader.put("Authorization", "key=<my_key>")


Below is the reference question in stackoverflow 

http://stackoverflow.com/questions/26135869/google-app-engine-blocking-outbound-request-for-fetching-oauth-token-from-google

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Reply via email to