2015-02-05

Auth0 + Google App Engine (Java) = "Running on GAE? Fine. No cookie support for you!"

Had some troubles implementing Auth0 Java example code to Google App Engine since ...


  1. W2015-02-05 20:25:28.236
    [s~workaround-town/1.382027755131049112].<stderr>: No CookieHandler. Running on GAE? Fine. No cookie support for you!
    
    
  2. W2015-02-05 20:25:28.239
    Error for /auth0-callback/
    java.lang.ExceptionInInitializerError
     at com.auth0.Auth0ServletCallback.createResty(Auth0ServletCallback.java:168)
     at com.auth0.Auth0ServletCallback.fetchTokens(Auth0ServletCallback.java:109)
     at com.auth0.Auth0ServletCallback.doGet(Auth0ServletCallback.java:73)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
     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 se.ce.workaround.WorkaroundFilter.doHttpFilter(WorkaroundFilter.java:145)
     at se.ce.util.web.singlepage.DefaultFilter.doFilter(DefaultFilter.java:38)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:58)
     at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:48)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
     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 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.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:254)
     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.headerComplete(HttpConnection.java:923)
     at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
     at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
     at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:484)
     at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438)
     at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445)
     at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
     at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309)
     at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)
     at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442)
     at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
     at java.lang.Thread.run(Thread.java:724)
    Caused by: java.security.AccessControlException: access denied ("java.net.NetPermission" "setDefaultAuthenticator")
     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:375)
     at java.security.AccessController.checkPermission(AccessController.java:565)
     at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
     at com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:56)
     at java.net.Authenticator.setDefault(Authenticator.java:127)
     at us.monoid.web.Resty.<clinit>(Resty.java:94)
     ... 43 more
    
  3. W2015-02-05 20:25:28.241
    Nested in java.lang.ExceptionInInitializerError:
    java.security.AccessControlException: access denied ("java.net.NetPermission" "setDefaultAuthenticator")
     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:375)
     at java.security.AccessController.checkPermission(AccessController.java:565)
     at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
     at com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:56)
     at java.net.Authenticator.setDefault(Authenticator.java:127)
     at us.monoid.web.Resty.<clinit>(Resty.java:94)
     at com.auth0.Auth0ServletCallback.createResty(Auth0ServletCallback.java:168)
     at com.auth0.Auth0ServletCallback.fetchTokens(Auth0ServletCallback.java:109)
     at com.auth0.Auth0ServletCallback.doGet(Auth0ServletCallback.java:73)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
     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 se.ce.workaround.WorkaroundFilter.doHttpFilter(WorkaroundFilter.java:145)
     at se.ce.util.web.singlepage.DefaultFilter.doFilter(DefaultFilter.java:38)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:58)
     at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:48)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
     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 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.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:254)
     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.headerComplete(HttpConnection.java:923)
     at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
     at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
     at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:484)
     at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438)
     at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445)
     at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
     at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309)
     at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)
     at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442)
     at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
     at java.lang.Thread.run(Thread.java:724)
    
  4. C2015-02-05 20:25:28.244
    Uncaught exception from servlet
    java.lang.ExceptionInInitializerError
     at com.auth0.Auth0ServletCallback.createResty(Auth0ServletCallback.java:168)
     at com.auth0.Auth0ServletCallback.fetchTokens(Auth0ServletCallback.java:109)
     at com.auth0.Auth0ServletCallback.doGet(Auth0ServletCallback.java:73)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
     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 se.ce.workaround.WorkaroundFilter.doHttpFilter(WorkaroundFilter.java:145)
     at se.ce.util.web.singlepage.DefaultFilter.doFilter(DefaultFilter.java:38)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:58)
     at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:48)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
     at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
     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 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.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:254)
     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.headerComplete(HttpConnection.java:923)
     at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
     at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
     at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:484)
     at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438)
     at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445)
     at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
     at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309)
     at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)
     at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442)
     at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
     at java.lang.Thread.run(Thread.java:724)
    Caused by: java.security.AccessControlException: access denied ("java.net.NetPermission" "setDefaultAuthenticator")
     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:375)
     at java.security.AccessController.checkPermission(AccessController.java:565)
     at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
     at com.google.apphosting.runtime.security.CustomSecurityManager.checkPermission(CustomSecurityManager.java:56)
     at java.net.Authenticator.setDefault(Authenticator.java:127)
     at us.monoid.web.Resty.<clinit>(Resty.java:94)
     ... 43 more
Will create a Auth0Callback suited for Google App Engine. Take a look at my Github:
https://github.com/AIMMOTH/GAEAuth0Callback

Inga kommentarer:

Skicka en kommentar