RepositoryPythonCACanada
alexferl

alexferl/flask-simpleldap

LDAP authentication extension for the Flask web framework

183sao
53fork
0issue
0lượt xem

🔐 Flask-SimpleLDAP: Xác thực LDAP nhanh cho Flask

Một extension Python nhẹ, mang LDAP authentication trực tiếp vào ứng dụng Flask chỉ với vài dòng cấu hình.

Flask-SimpleLDAP là một extension cho Flask hỗ trợ xác thực người dùng qua máy chủ LDAP. Dự án tương thích với Python 3.10+, dựa trên thư viện python-ldap, và cung cấp các decorator như @ldap.basic_auth_required, @ldap.login_required, @ldap.group_required() để bảo vệ route một cách đơn giản.

✨ Điểm nổi bật

  • Cài đặt nhanh: pip install flask-simpleldap, tự động cài Flask và python-ldap.
  • Xác thực HTTP Basic: Dùng @ldap.basic_auth_required để bảo vệ route bằng popup đăng nhập trình duyệt.
  • Đăng nhập form/cookie: Hỗ trợ @ldap.login_required thay thế Basic Auth bằng form và cookie.
  • Phân quyền theo nhóm: Dùng @ldap.group_required() để giới hạn truy cập theo nhóm LDAP.
  • Hỗ trợ OpenLDAP: Cấu hình riêng cho schema và bộ lọc đối tượng nhóm của OpenLDAP.
  • Tích hợp với Blueprint và Application Factory: Ví dụ đi kèm sẵn theo mẫu ứng dụng Flask hiện đại.
  • Cấu hình linh hoạt: Bảng cấu hình chi tiết với hơn 20 tùy chọn như host, port, schema, timeout, TLS/SSL.
  • Lấy thông tin người dùng: Truy cập tên người dùng qua g.ldap_username sau khi xác thực thành công.

💡 Vì sao đáng chú ý

Không cần viết lại logic kết nối LDAP hay quản lý session — Flask-SimpleLDAP cung cấp sẵn các decorator và lớp LDAP để tích hợp nhanh. Đặc biệt phù hợp với dự án nội bộ hoặc ứng dụng doanh nghiệp dùng LDAP/OpenLDAP để quản lý người dùng và nhóm. Các ví dụ thực tế (basic_auth, groups, blueprints) giúp người dùng tiếp cận nhanh từ cơ bản đến nâng cao.


#Flask #LDAP #Authentication #Python #OpenSource #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryPython
yt-dlp/yt-dlp

A feature-rich command-line audio/video downloader

203.3k
Oct 26, 2026
RepositoryPython
521xueweihan/HelloGitHub

:octocat: 分享 GitHub 上有趣、入门级的开源项目。Share interesting, entry-level open source projects on GitHub.

185.3k
Oct 28, 2026
RepositoryPython
Asabeneh/30-Days-Of-Python

The 30 Days of Python programming challenge is a step-by-step guide to learn the Python programming language in 30 days. This challenge may take more than 100 days. Follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw

77.4k
Sep 30, 2026
RepositoryPython
pallets/flask

The Python micro framework for building web applications.

75.1k
Oct 7, 2026
RepositoryPython
donnemartin/system-design-primer

Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.

375.9k
Sep 15, 2026
RepositoryPython
vinta/awesome-python

The definitive list that answers "I want to do X in Python, which tool should I use?"

330.9k
Oct 28, 2026
RepositoryPython
practical-tutorials/project-based-learning

Curated list of project-based tutorials

288.3k
Oct 26, 2026
RepositoryPython
TheAlgorithms/Python

All Algorithms implemented in Python

225.6k
Oct 20, 2026
RepositoryPython
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

187.8k
Oct 28, 2026