Hacker News 中文摘要

RSS订阅

克拉托斯 - 云原生Auth0开源替代方案(自托管) -- Kratos - Cloud native Auth0 open-source alternative (self-hosted)

文章摘要

Kratos是一个用Go编写的无头云原生身份认证管理系统,可支持十亿级用户规模,提供Passkeys、社交登录、OIDC、多因素认证等多种功能,旨在替代自建或第三方认证服务,具有更好的用户体验和开发者体验,可在任何环境运行,尤其适合Ory网络。

文章总结

GitHub 项目:Ory Kratos

项目简介
Ory Kratos 是一个基于 Go 语言开发的无头(Headless)云原生身份认证与用户管理系统,专为现代应用程序设计。它通过集中化登录、注册、账户恢复、验证和资料管理等流程,帮助开发者避免重复实现这些功能。其核心特点包括:

  • 无头架构:通过 API 提供身份管理服务,与前端框架解耦。
  • 高扩展性:支持十亿级用户规模。
  • 多场景认证:支持密码、社交登录(OIDC)、魔法链接、多因素认证(MFA)、短信验证、SAML、TOTP 等。
  • 跨平台运行:可在任何环境部署,最佳运行于 Ory Network

核心功能

  1. 用户生命周期管理
    • 自助注册/登录、账户验证与恢复、多因素认证、资料管理。
  2. 身份协议支持
    • OAuth 2.0、OpenID Connect (OIDC)、SAML、WebAuthn(Passkeys)等。
  3. 替代方案
    可替代自建系统或商业服务(如 Auth0、Okta、Firebase),提供更优的开发者体验(DX)和用户体验(UX)。

部署选项

  1. Ory Network(托管服务)
    • 全托管解决方案,含 SLA 支持、预构建 UI 组件和自动化扩展。
    • 适合需要快速上线的企业。免费注册
  2. 自托管
    • 支持 Docker、Kubernetes,兼容 PostgreSQL/MySQL/CockroachDB。
    • 开源版本适用于实验或非关键业务;企业版(OEL)提供高级功能(如 SCIM、SAML、企业支持)。

快速开始

  1. 安装 Ory CLI: bash bash <(curl https://raw.githubusercontent.com/ory/meta/master/install.sh) -b . ory sudo mv ./ory /usr/local/bin/
  2. 创建项目并启动: bash ory auth ory create project --name "My Project"

生态集成

  • Ory Hydra:OAuth2/OpenID Connect 服务。
  • Ory Oathkeeper:身份与访问代理。
  • Ory Keto:基于策略的访问控制。

用户案例

包括 OpenAI、Fandom、Klarna、Cisco 等企业,覆盖电商、金融、政府等领域。查看案例研究


开发者资源

  • 文档Ory Kratos 文档
  • 贡献指南:接受符合规范的 PR,需通过测试(单元测试/E2E)。
  • 安全:漏洞披露请邮件至 security@ory.sh

许可证:Apache-2.0
代码仓库GitHub - ory/kratos

评论总结

以下是评论内容的总结:

对Ory Kratos的正面评价

  1. 功能强大且可定制

    • "It worked pretty well... a great project to work with that has tons of knobs to customize" (caleblloyd)
    • "Kratos is awesome, especially alongside Hydra, OathKeeper, and Keto. Super powerful combo" (bitcrshr)
  2. 适合自托管

    • "if you need self host your IdP, just go for it, you cannot go wrong" (lxdlam)
    • "Really easy to maintain with simple configuration and fully featured API" (lxdlam)

对Ory Kratos的负面评价

  1. 文档和配置复杂

    • "The doc is clearly written in a way to steer you toward their cloud... Setting things up is not straight forward" (Sytten)
    • "I had to dig really far to find answers to some fairly common issues" (bitcrshr)
  2. 部分功能限制

    • "Additional enterprise features that are not available in the open source version" (parliament32)
    • "The fact that they wont do SAML in kratos cause its part of their cloud thing" (Sytten)

对其他身份验证解决方案的推荐

  1. Keycloak

    • "Keycloak ended up being quite extensible and powerful" (nja)
    • "though I’m not sure it has ever described itself that way" (nja)
  2. Kanidm

    • "the project was easy to learn and understand and it wasn’t that hard to hook things up to it" (ethin)
    • "It has it’s quirks, but it’s been phenomenal so far" (ethin)
  3. Authentik

    • "I would check out Authentik before commiting to any idP" (dizhn)
    • "Super nice developer too" (dizhn)

其他观点

  1. 对数据库存储的质疑

    • "Storing auth data in MySQL or Postgres is insane and defeats the purpose of trying to be secure" (otabdeveloper4)
  2. 对开发者体验的推荐

    • "In the TypeScript ecosystem, I’d probably take a look at Better Auth though, as the developer experience is really great!" (larrywinch)
  3. 对文档的批评

    • "Their documentation is really bad, especially in OSS suites" (lxdlam)
  4. 对商业策略的看法

    • "OSS for ory is a growth strategy, their enterprise version cloud is also not the same as the OSS one" (Sytten)

总结显示,Ory Kratos在功能和自托管方面受到好评,但在文档和部分功能限制上受到批评。其他解决方案如Keycloak、Kanidm和Authentik也因其易用性和扩展性被推荐。