passportd
认证、授权、统一登录 — 基于 Flask 的 SSO 单点登录服务。
核心功能
- 本地账号系统:支持用户名、手机号、邮箱注册与登录
- WebAuthn Passkey:支持指纹/面容/PIN 码免密登录,兼容 Windows Hello、Apple Touch ID、YubiKey、Vaultwarden 等
- OAuth2 第三方登录:内置 GitHub、Gitee、Weibo、QQ、Google等 OAuth2 登录插件
- OpenID Connect Provider:支持 OIDC Server 模式,可作为独立 SSO 服务
- 插件扩展:基于 Flask-PluginKit 的插件架构,方便扩展更多登录方式
- 多数据库支持:SQLite(开发) / MySQL / PostgreSQL(生产)
- JWT 认证:支持 HMAC-SHA256 和 RS256 双算法 JWT 签名
- RESTful API:提供完整的注册、登录、用户信息、OIDC 客户端管理接口
- 后台管理:admin / superadmin 可管理用户角色与 OIDC 应用(内部应用标记),写操作记入安全审计日志
快速开始
pip 安装
# 安装
pip install passportd
# 确保 Redis 已启动
# 开发模式启动
passportd run
# 生产模式启动
passportd start
访问 http://localhost:10030/ 即可看到登录页面。
Docker 运行
# 拉取镜像
docker pull staugur/passportd:latest
# 启动容器(需要先启动 Redis)
docker run -d \
--name passportd \
-p 10030:10030 \
-e PASSPORT_REDIS_URI="redis://:pwd@redis:6379/0" \
-e PASSPORT_DB_URI="sqlite:///app/data/passportd.db" \
-e PASSPORT_ENV="production" \
-v passportd-data:/app/data \
staugur/passportd:latest
也可以通过 docker-compose.yml 一键启动(包含 Redis):
version: "3.8"
services:
redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
- redis-data:/data
passportd:
image: staugur/passportd:latest
restart: unless-stopped
ports:
- "10030:10030"
environment:
- PASSPORT_ENV=production
- PASSPORT_REDIS_URI=redis://redis:6379/0
- PASSPORT_DB_URI=sqlite:///app/data/passportd.db
volumes:
- passportd-data:/app/data
depends_on:
- redis
volumes:
redis-data:
passportd-data:
文档
完整文档请访问 passportd.readthedocs.io
本地构建文档:
pip install -r requirements/docs.txt
cd docs && make html
许可证
Apache License 2.0
备注
沿用 1.x 设计思路,使用 OIDC 标准协议重构实现,除核心代码外大部分使用 AI 生成。
如从 1.x 迁移,可使用 tools 脚本。
Metadata
Release files for passportd 2.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| passportd-2.9.0.tar.gz | 3.7 MB | With provenance | Details for passportd-2.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| passportd-2.9.0-py3-none-any.whl | Python 3 | none | any | Details for passportd-2.9.0-py3-none-any.whl |
Total release size: 7.5 MB
Release files / passportd-2.9.0.tar.gz
| Download URL | passportd-2.9.0.tar.gz |
|---|---|
| Size | 3.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26c2751cbf5f5c9095a27d0e925fee7a23004afd95b3864d15508090f4d47a29
|
|
BLAKE2b-256 checksum How to use checksums |
ac2c4d26cf907ccf6fdf8856445e61a5800724cb38923c3efd097e25c311efd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / passportd-2.9.0-py3-none-any.whl
| Download URL | passportd-2.9.0-py3-none-any.whl |
|---|---|
| Size | 3.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0038501f0b186ff56e07ac9e15aae9c3749139cde4e86760d03bf3ab82eb8f07
|
|
BLAKE2b-256 checksum How to use checksums |
58de8bd6250d932bcd5018826a30cf00fb154cb34307fc9d90fcb117852efb49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logSecurity for passportd 2.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for passportd-2.9.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.