I see how we can authenticate SQL Anywhere users using an LDAP server. My question is: Can we obtain in SQL Anywhere code the LDAP Group that the authenticated user is a member of? More generally, can anyone provide any guidance on querying LDAP server data from SQL Anywhere code? Thanks! asked 09 Apr '20, 10:17 dharrel |
Did you read this article in the SQL Anywhere Wiki?
Thanks. It's not what I'm looking for, though. I'm looking for an LDAP API that can be easily called from SQL Anywhere stored procedure code. I need to query LDAP data.
Can anyone refer me to such an LDAP API?
Well, SQL Anywhere supports stored functions and procedures using external calls - among others in C, so you could call any LDAP C API from SQL Anywhere, e.g. that from the MS Windows SDK, or APIs in the other languages supported by external calls (.NET, Java, JavaScript, Perl, PHP). However, writing external functions/procedures is usually not that easy...
Probably it would be easier to use cmd_shell to call an according LDAP command line tool to do the actual LDAP query and analyze its output within the database server.
Note: I have not tried any of the above but have both worked with external C calls and calling cmd_shell.