Need to call ldap in App Engine's Python envir

2020-04-21 02:41发布

问题:

I'm trying to add an Ldap authentication backend to a Django project running over GAE. The project runs ok. The only problem really is Ldap is not supported by GAE. I mean:

import ldap

will generate a server error. Nonetheless, I do know that I could make my own modules available through zipimport.

Does anybody have any experience solving similar issues? Can this sort of workaround be an effective solution considering lower level dependencies?

Thanks! A.

回答1:

App Engine doesn't let you open sockets directly. Unless the LDAP server you're planning to connect to has an internet-visible HTTP front-end, you need a Plan B. (E.g., you could periodically upload extract from LDAP to your App.)

See http://code.google.com/appengine/docs/python/runtime.html#The_Sandbox