When I try to access a specific Auth0 URL (https://ssodev.gaf.com/oauth/token) via Google App Engine standard, my servlet times out (the log shows “Process terminated because the request deadline was exceeded” after about 100 seconds). If I try to access a different Auth0 URL (https://pushpin.auth0.com/oauth/token) my servlet does not time out. What is going on?
Interestingly, I can access both URLs in a Google Cloud Shell:
curl --request GET --url https://ssodev.gaf.com/oauth/token
curl --request GET --url https://pushpin.auth0.com/oauth/token
Neither of these time out.
My code is below. I started with the getting started java example (GitHub - GoogleCloudPlatform/getting-started-java). I only changed the HelloAppEngine.doGet method.
@WebServlet(name = "HelloAppEngine", value = "/hello")
public class HelloAppEngine extends HttpServlet {
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
//String url = "http://mit.edu"; // This works
//String url = "https://pushpin.auth0.com/oauth/token"; // This works
String url = "https://ssodev.gaf.com/oauth/token"; // This times out
try {
InputStream in = new URL(url).openStream();
}
catch(Exception exception) { }
}
}