yzhbest / google-plugin-for-eclipse

Automatically exported from code.google.com/p/google-plugin-for-eclipse
Eclipse Public License 1.0
0 stars 0 forks source link

OAuth for App Engine clients #342

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
ClientLogin support ends on January 20th, 2016. We have to use OAuth.
But when we try to use it in Google Eclipse Plugin it throws an exception:

    java.lang.IllegalStateException: OAuth-based authorization not supported for clients running on App Engine
    at com.google.appengine.tools.remoteapi.RemoteApiOptions.getOrCreateHttpTransportForOAuth(RemoteApiOptions.java:359)
    at com.google.appengine.tools.remoteapi.RemoteApiOptions.useApplicationDefaultCredential(RemoteApiOptions.java:162)

This is critical because:
- the ClientLogin support ends in 2 months, 
- there is no other way than using OAuth,
- most of the time developers have to debug on deployed database (Duplicating 
it locally is almost impossible because of its size and real-time nature).

Original issue reported on code.google.com by keremo...@gmail.com on 21 Nov 2015 at 9:34

GoogleCodeExporter commented 8 years ago
related: https://code.google.com/p/googleappengine/issues/detail?id=12556

Original comment by keremo...@gmail.com on 27 Nov 2015 at 2:03

GoogleCodeExporter commented 8 years ago
Which version of the Eclipse Plugin are you using?
Can you retry with the latest 1.9.30 SDK version plugin?

Original comment by l...@google.com on 2 Dec 2015 at 5:11

GoogleCodeExporter commented 8 years ago
Hi,
I'm experiencing exactly the same issue.
Currently using Google Plugin for Eclipse 4.4 with the latest 1.9.30 SDK 
version and the exception is still there.

Original comment by dounia.c...@progis.fr on 3 Dec 2015 at 3:44

GoogleCodeExporter commented 8 years ago
Hi - I was able to deploy successfully using the latest version of GPE on 
Eclipse 4.5. 

Is that the full stack trace that you're seeing/posting?

Also, can you give me the exact repro steps?

Original comment by rdayal@google.com on 11 Dec 2015 at 7:12

GoogleCodeExporter commented 8 years ago

Original comment by rdayal@google.com on 11 Dec 2015 at 7:12

GoogleCodeExporter commented 8 years ago
What do you mean by "deploy"? I just want to connect my database remotely with 
my local eclipse GPE app engine server code.

I am on a train without the development environment. I will try to send the 
full stack of exception in a couple of days.

But if SDK 1.9.30 has the hard-coded line "OAuth-based authorization not 
supported for clients running on App Engine" in the source code then the 
problem still exists.

https://code.google.com/p/googleappengine/source/browse/trunk/java/src/main/com/
google/appengine/tools/remoteapi/RemoteApiOptions.java#324

Original comment by keremo...@gmail.com on 12 Dec 2015 at 10:55

GoogleCodeExporter commented 8 years ago
Ok. I guess this isn't a deployment problem at all. Let me figure out who can 
look into this.

Original comment by rdayal@google.com on 14 Dec 2015 at 11:42

GoogleCodeExporter commented 8 years ago
(posting the full stack grace would still be helpful)

Original comment by rdayal@google.com on 14 Dec 2015 at 11:44

GoogleCodeExporter commented 8 years ago
(posting the full stack grace would still be helpful)

Original comment by rdayal@google.com on 14 Dec 2015 at 11:44

GoogleCodeExporter commented 8 years ago
Also, can you tell me how you've set up your connection to the remote database 
in GPE. I just need the repro steps.

Original comment by rdayal@google.com on 14 Dec 2015 at 11:47

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I use GWT. Basicly I add two methods to my class which extends 
RemoteServiceServlet.

public class GreetingServiceImpl extends RemoteServiceServlet implements 
GreetingService {
    @Override
    protected void onBeforeRequestDeserialized(String serializedRequest) {
        if (installer == null) {
        installer = new RemoteApiInstaller();
            try {
                if (options == null)
                    options = new RemoteApiOptions().server("example.appspot.com", 443).useApplicationDefaultCredential();
                installer.install(options);
            }
            catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    protected void onAfterResponseSerialized(String serializedResponse) {
        if (installer != null) {
            try {
                installer.uninstall();
            }
            catch (Exception e) {
                e.printStackTrace();
            }
            finally {
                installer = null;
            }
        }
    }   
}

Original comment by keremo...@gmail.com on 15 Dec 2015 at 8:11

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Full stack is the following for GPE 1.9.28
GreetingServiceImpl.java:5139 is the line where 
useApplicationDefaultCredential() is.

java.lang.IllegalStateException: OAuth-based authorization not supported for 
clients running on App Engine
    at com.google.appengine.tools.remoteapi.RemoteApiOptions.getOrCreateHttpTransportForOAuth(RemoteApiOptions.java:359)
    at com.google.appengine.tools.remoteapi.RemoteApiOptions.useApplicationDefaultCredential(RemoteApiOptions.java:162)
    at com.myexample.GreetingServiceImpl.onBeforeRequestDeserialized(GreetingServiceImpl.java:5139)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
    at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
    at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:502)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Original comment by keremo...@gmail.com on 15 Dec 2015 at 8:30

GoogleCodeExporter commented 8 years ago
And for GPE 1.9.30, the full stack is:

java.lang.IllegalStateException: OAuth-based authorization not supported for 
clients running on App Engine
    at com.google.appengine.tools.remoteapi.RemoteApiOptions.getOrCreateHttpTransportForOAuth(RemoteApiOptions.java:361)
    at com.google.appengine.tools.remoteapi.RemoteApiOptions.useApplicationDefaultCredential(RemoteApiOptions.java:162)
    at com.myexample.GreetingServiceImpl.onBeforeRequestDeserialized(GreetingServiceImpl.java:5139)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:128)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
    at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
    at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:512)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Original comment by keremo...@gmail.com on 15 Dec 2015 at 9:11

GoogleCodeExporter commented 8 years ago
Hi,

This error is actually not related to the Google Plugin for Eclipse at all, and 
it is indeed a pure App Engine issue.

I will update the original thread accordingly:

https://code.google.com/p/googleappengine/issues/detail?id=12556

Original comment by clall...@google.com on 15 Dec 2015 at 10:13

GoogleCodeExporter commented 8 years ago
Thanks. Closing this out. 

Original comment by rdayal@google.com on 30 Dec 2015 at 8:58

GoogleCodeExporter commented 8 years ago

Original comment by rdayal@google.com on 30 Dec 2015 at 8:58