django-allauth README

The project's README from github.com/pennersr/django-allauth. As one markdown file: README.md.

========================== Welcome to django-allauth!

.. image:: https://codeberg.org/allauth/allauth.org/raw/commit/da3b56390e1b18eaec09b05cd89dfa7812212dfc/content/news/2024/04/website-redesign/logo-light.png :target: https://allauth.org :align: right :alt: django-allauth logo :width: 250px

.. |ci| image:: https://img.shields.io/github/actions/workflow/status/pennersr/django-allauth/ci.yml.svg :target: https://github.com/pennersr/django-allauth/actions .. |pypi| image:: https://img.shields.io/pypi/v/django-allauth :target: https://pypi.python.org/pypi/django-allauth .. |cov| image:: https://img.shields.io/coverallsCoverage/github/pennersr/django-allauth :alt: Coverage Status :target: https://coveralls.io/r/pennersr/django-allauth .. |btc| image:: https://img.shields.io/badge/bitcoin-donate-yellow :target: https://blockchain.info/address/1AJXuBMPHkaDCNX2rwAy34bGgs7hmrePEr .. |liberapay| image:: https://img.shields.io/liberapay/receives/pennersr :target: https://en.liberapay.com/pennersr .. |pystyle| image:: https://img.shields.io/badge/code_style-pep8-green :target: https://www.python.org/dev/peps/pep-0008/ .. |jsstyle| image:: https://img.shields.io/badge/code_style-standard-brightgreen :target: http://standardjs.com .. |editor| image:: https://img.shields.io/badge/editor-emacs-purple :target: https://www.gnu.org/software/emacs/ .. |i18n| image:: https://img.shields.io/weblate/progress/allauth :target: https://hosted.weblate.org/projects/allauth/django-allauth/ .. |pypidl| image:: https://img.shields.io/pypi/dm/django-allauth :target: https://pypistats.org/packages/django-allauth :alt: PyPI - Downloads .. |djangodemo| image:: https://img.shields.io/badge/%E2%96%B6_demo-Django_project-red :target: https://django.demo.allauth.org/ :alt: View Django Demo .. |reactdemo| image:: https://img.shields.io/badge/%E2%96%B6_demo-React_SPA-red :target: https://react.demo.allauth.org/ :alt: View React SPA Demo

|ci| |pypi| |cov| |btc| |liberapay| |pystyle| |jsstyle| |editor| |i18n| |pypidl| |djangodemo| |reactdemo|

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.

Home page https://allauth.org/

Source code https://codeberg.org/allauth/django-allauth

Issue Tracker https://codeberg.org/allauth/django-allauth/issues

Documentation https://docs.allauth.org/en/latest/

Stack Overflow https://stackoverflow.com/questions/tagged/django-allauth

Demo https://django.demo.allauth.org and https://react.demo.allauth.org

Translations https://hosted.weblate.org/projects/allauth/django-allauth/

.. end-welcome

Rationale

.. begin-rationale

Most existing Django apps that address the problem of social authentication unfortunately focus only on one dimension - the social. Most developers end up integrating another app in order to support authentication flows that are locally generated.

This approach creates a development gap between local and social authentication flows. It has remained an issue in spite of numerous common scenarios that both require. For example, an email address passed along by an OpenID provider may not be verified. Therefore, prior to hooking up an OpenID account to a local account the email address must be verified. This essentially is one of many use cases that mandate email verification to be present in both worlds.

Integrating both is a humongous and tedious process. It is not as simple as adding one social authentication app, and one local account registration app to your INSTALLED_APPS list.

This inadequacy is the reason for this project's existence -- to offer a fully integrated authentication app that allows for both local and social authentication, with flows that just work, beautifully!

.. end-rationale

Features

.. begin-features

🔑 Comprehensive account functionality Supports multiple authentication schemes (e.g. login by user name, or by email), as well as multiple strategies for account verification (ranging from none to mandatory email verification).

👥 Social Login Login using external identity providers, supporting any Open ID Connect compatible provider, many OAuth 1.0/2.0 providers, as well as custom protocols such as, for example, Telegram authentication.

💼 Enterprise ready Supports SAML 2.0, which is often used in a B2B context.

🕵️ Battle-tested The package has been out in the open since 2010. It is in use by many commercial companies whose business depends on it and has hence been subjected to various penetration testing attempts.

⏳Rate limiting When you expose an authentication-enabled web service to the internet, it is important to be prepared for potential brute force attempts. Therefore, rate limiting is enabled out of the box.

🔒 Private Many sites leak information. For example, on many sites you can check whether someone you know has an account by input their email address into the password forgotten form, or trying to signup with it. We offer account enumeration prevention, making it impossible to tell whether or not somebody already has an account.

🧩 Customizable As a developer, you have the flexibility to customize the core functionality according to your specific requirements. By employing the adapter pattern, you can effortlessly introduce interventions at the desired points to deviate from the standard behavior. This level of customization empowers you to tailor the software to meet your unique needs and preferences.

⚙️ Configuration The required consumer keys and secrets for interacting with Facebook, X (Twitter) and the likes can be configured using regular settings, or, can be configured in the database via the Django admin. Here, optional support for the Django sites framework is available, which is helpful for larger multi-domain projects, but also allows for easy switching between a development (localhost) and production setup without messing with your settings and database.

.. end-features

Commercial Support

.. begin-support

Commercial support is available. If you find certain functionality missing, or require assistance on your project(s), please contact us: [email protected].

.. end-support

django-allauth (pennersr/django-allauth)

Searching Database…

这是什么?一套集成的 Django 应用,涵盖身份验证、注册、账户管理以及第三方(社交)账号登录——把本地登录和社交登录流程整合在同一个包里。
这是一个需要我自己部署的独立服务,还是给我自己应用用的库?它是一个库:一组可以加进你自己项目的 Django 应用。不需要单独运行什么服务器——它就运行在你的 Django 网站内部,复用网站的数据库和模板。
我怎么把它装到我的 Django 项目里?从 PyPI 安装(pip install django-allauth),然后把相关应用加到 INSTALLED_APPS 里。各个登录渠道的密钥(key)和机密(secret)可以写在普通的 Django 设置文件里,也可以通过 Django 后台存进数据库。
用户实际可以用哪些方式登录?可以本地登录,用用户名或邮箱。社交登录方面,它支持任何兼容 OpenID Connect 的服务、大量 OAuth 1.0/2.0 服务,以及 Telegram 登录这类自定义协议。
它只能配合 Django 使用,还是也能用在 Flask 或 FastAPI 上?它和 Django 绑定——它本身就是一组 Django 应用,所以只能装进 Django 项目。
我们在做一个 B2B 产品,它能处理 SAML 这类企业级登录吗?可以,README 称它已达到企业级水准:对于客户通过自己的身份服务商登录的 B2B 场景,它支持 SAML 2.0。
怎么防止别人暴力破解登录或探测别人的账号?它默认自带限流机制来应对暴力破解尝试,而且有账号枚举防护,让人无法判断某个邮箱是否已经注册过账号。
用户必须先确认邮箱地址才能使用网站吗?这由你决定:allauth 支持多种账号验证策略,从完全不做验证到强制邮箱验证都有,注册要多严格由你自己定。
如果默认的注册或登录流程不适合我的应用怎么办?你可以不完全按默认行为来:适配器(adapter)模式让你能在需要的环节介入,定制核心功能,而不用分叉(fork)这个包。
在接入我自己的项目之前,能先看看它实际跑起来是什么样吗?可以——README 里链接了一个 Django 演示和一个 React SPA 演示,你可以先点进去体验。
它够成熟吗,敢把生产环境的整个应用押在它上面?它从 2010 年起就开源发布,被一些业务依赖它的商业公司使用,也因此经受过各种渗透测试的考验。
What are similar projects?zitadel, logto, authelia, kratos, cas, casdoor, better-auth, authentik
Creator
pennersr
Size
21.7 MB
Stars
10.4K
Updated
CommitOct 16
Age
16y
Commits · 90 Days