I've been developing an app in R Shiny and deployed it locally at my company. I'm trying to set up an authentication process using an LDAP server. I managed to connect to the LDAP server using an admin account specific to the app; however, I can't perform searches in the directory to find users allowed to use the app.
Here is my draft code:
library(yaml)
config <- yaml::read_yaml("path_to/config.yml")
library(reticulate)
# use_python("C:/Users/cal14236/AppData/Local/Programs/Python/Python313/python.exe", required = TRUE)
use_virtualenv("~/.virtualenvs/r-reticulate", required = TRUE)
py_config()
# py_install("ldap3")
ldap3 <- import("ldap3")
# Créer un serveur LDAP
server <- ldap3$Server(config$ldap$server)
# Créer une connexion
conn <- ldap3$Connection(
server,
user = config$ldap$bind_user,
password = config$ldap$bind_password,
auto_bind = TRUE
)
conn$search(
search_base = "ou=StatiCAL,dc=testcal,dc=local",
search_filter = "(cn=username)",
attributes = "cn"
)
Here is the LDAP configuration:

I really can't find the problem, I tried to see if this was a permission issue but the IT said no.
auth-ldapand similar modules for handling authentication. In general they tend to be a little safer in that you don't miss a corner-case in your "R" code that allows access that inadvertently allows access. Sometimes you can get details user/group context in headers.