Apigee X- Ldap via Java callout issue

Hi @dchiesa1 ,

 I am trying to invoke ldap server from Apigee X from via Java callout policy.  And I am getting below error

javax.naming.CommunicationException: xyz.com:1636 [Root exception is java.security.AccessControlException: access denied ("java.net.SocketPermission" "**.**.**.78:1636" "connect,resolve")]

 

As per Java permission reference, SocketPermission is disabled, I think. Is there any way in APIGEE X we can enable it?

https://docs.apigee.com/api-platform/reference/java-permission-reference

Solved Solved
0 1 141
1 ACCEPTED SOLUTION

You can't do that. 

The Apigee gateway is not a general purpose application server or container.  There are some things you are not permitted to do in your Java code.  LDAP is one of them - you can't open arbitrary sockets. You also cannot read filesystem files, you can't read system properties, lots of other things.

This example shows how you can use an ExternalCallout with Apigee X, pointing to a server (hosted in Google Cloud run, or etc) which does the LDAP connection. The ExternalCallout connects with the server via GRPC, which is speedy and efficient. 

View solution in original post

1 REPLY 1

You can't do that. 

The Apigee gateway is not a general purpose application server or container.  There are some things you are not permitted to do in your Java code.  LDAP is one of them - you can't open arbitrary sockets. You also cannot read filesystem files, you can't read system properties, lots of other things.

This example shows how you can use an ExternalCallout with Apigee X, pointing to a server (hosted in Google Cloud run, or etc) which does the LDAP connection. The ExternalCallout connects with the server via GRPC, which is speedy and efficient.