I have a GoogleAppEngine application that is required to connect to another localhost server, but when I'm trying to do this from the server code, I get:
java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve)
I know that I can specify my additional security grant by using java virtual machine arguments (I specify them in Web Application run configuration):
java -Djava.security.manager -Djava.security.policy=WEB-INF/java.policy
with java.policy
contents:
grant {
permission java.net.SocketPermission "localhost:8081", "connect, resolve";
};
but it overrides the GoogleAppEngine internal security manager which is located in private class at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager
, so the properties, required for AppEngine itself are disabled in that way.
Is there any way to make GoogleAppEngine internal security manager class use my policy file instead of replacing it manually with a stub (allowing anything) file in a jar?
Go to the Security section of your Google Account. Under “Third-party apps with account access,” select Manage third-party access. Select the app or service you want to remove. Select Remove Access.
App Engine Admin ( roles/appengine.appAdmin ) Read/Write/Modify access to all application configuration and settings. To deploy new versions, a principal must have the Service Account User ( roles/iam. serviceAccountUser ) role on the App Engine default service account, and the Cloud Build Editor ( roles/cloudbuild.
You can't open sockets on App Engine. You need to use the URLFetch API, either via java.net or directly. How do you expect to access 'localhost' when your app has been uploaded to App Engine, though?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With