You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 104904e
Browse filesBrowse the repository at this point in the historyBrowse files
`bind_dn` / `bind_password` are for a **service account** (connection pool and LDAP searches). End users authenticate with their own username and password via HTTP Basic Auth on protected routes — do not use the service password for user login.
user_search_base="DC=example,DC=com",# Use domain root unless you intentionally restrict OUs
151
156
group_search_filter="(member:1.2.840.113556.1.4.1941:={user_dn})", # Recursive group search
152
157
group_attribute="cn",
158
+
pool_max_idle_seconds=900, # Refresh idle connections; AD often drops them after ~15 min
153
159
)
154
160
```
155
161
162
+
HTTP Basic login accepts plain username, UPN (`user@example.com`), or NetBIOS (`DOMAIN\user`) — the client normalizes these for `sAMAccountName` search.
163
+
164
+
## Connection Pool and Long-Running Services
165
+
166
+
LDAP and Active Directory often close idle TCP connections. Without refresh, a backend that runs for hours may start returning `401 Invalid credentials` for valid users until restart.
167
+
168
+
`fastapi-ldap` mitigates this by:
169
+
170
+
- Rebinding to the service account on every pool checkout and return
0 commit comments