hydra README

The project's README from github.com/ory/hydra. As one markdown file: README.md.

Ory Hydra - Open Source OAuth 2 and OpenID Connect server

Chat · Discussions · Newsletter · Docs · Try Ory Network · Jobs

Ory Hydra is a hardened, OpenID Certified OAuth 2.0 Server and OpenID Connect Provider optimized for low-latency, high throughput, and low resource consumption. It connects to your existing identity provider through a login and consent app, giving you absolute control over the user interface and experience.


What is Ory Hydra?

Ory Hydra is a server implementation of the OAuth 2.0 authorization framework and the OpenID Connect Core 1.0. It follows cloud architecture best practices and focuses on:

We recommend starting with the Ory Hydra introduction docs to learn more about its architecture, feature set, and how it compares to other systems.

Why Ory Hydra

Ory Hydra is designed to:

OAuth2 and OpenID Connect: Open Standards

Ory Hydra implements Open Standards set by the IETF:

and the OpenID Foundation:

OpenID Connect Certified

Ory Hydra is an OpenID Foundation certified OpenID Provider (OP).

Ory Hydra is a certified OpenID Providier

The following OpenID profiles are certified:

To obtain certification, we deployed the reference user login and consent app (unmodified) and Ory Hydra v1.0.0.

Deployment options

You can run Ory Hydra in two main ways:

Use Ory Hydra on the Ory Network

The Ory Network is the fastest way to use Ory services in production. Ory OAuth2 & OpenID Connect is powered by the open source Ory Hydra server and is API compatible.

The Ory Network provides:

Sign up for a free developer account to get started.

Self-host Ory Hydra

You can run Ory Hydra yourself for full control over infrastructure, deployment, and customization.

The install guide explains how to:

This guide uses the open source distribution to get you started without license requirements. It is a great fit for individuals, researchers, hackers, and companies that want to experiment, prototype, or run unimportant workloads without SLAs. You get the full core engine, and you are free to inspect, extend, and build it from source.

If you run Hydra as part of a business-critical system, for example OAuth2 and OpenID Connect for all your users, you should use a commercial agreement to reduce operational and security risk. The Ory Enterprise License (OEL) layers on top of self-hosted Hydra and provides:

For guaranteed CVE fixes, current enterprise builds, advanced features, and support in production, you need a valid Ory Enterprise License and access to the Ory Enterprise Docker registry. To learn more, contact the Ory team.

Quickstart

Install the Ory CLI and create a new project to try Ory OAuth2 & OpenID Connect.

# Install the Ory CLI if you do not have it yet:
bash <(curl https://raw.githubusercontent.com/ory/meta/master/install.sh) -b . ory
sudo mv ./ory /usr/local/bin/

# Sign in or sign up
ory auth

# Create a new project
ory create project --create-workspace "Ory Open Source" --name "GitHub Quickstart" --use-project

Try out the OAuth 2.0 Client Credentials flow:

ory create oauth2-client \
    --name "Client Credentials Demo" \
    --grant-type client_credentials
# Note the client ID and secret from output

ory perform client-credentials \
    --client-id <your-client-id> \
    --client-secret <your-client-secret>
# Note the access token from output

ory introspect token <your-access-token>

Try out the OAuth 2.0 Authorize Code + OpenID Connect flow:

ory create oauth2-client \
    --name "Authorize Code with OpenID Connect Demo" \
    --grant-type authorization_code,refresh_token \
    --response-type code \
    --redirect-uri http://127.0.0.1:4446/callback

ory perform authorization-code \
    --client-id <your-client-id> \
    --client-secret <your-client-secret>

Who is using Ory Hydra

The Ory community stands on the shoulders of individuals, companies, and maintainers. The Ory team thanks everyone involved - from submitting bug reports and feature requests, to contributing patches and documentation. The Ory community counts more than 50.000 members and is growing. The Ory stack protects 7.000.000.000+ API requests every day across thousands of companies. None of this would have been possible without each and everyone of you!

The following list represents companies that have accompanied us along the way and that have made outstanding contributions to our ecosystem. If you think that your company deserves a spot here, reach out to [email protected] now!

Name Logo Website Case Study
OpenAI OpenAI openai.com OpenAI Case Study
Fandom Fandom fandom.com Fandom Case Study
Lumin Lumin luminpdf.com Lumin Case Study
Sencrop Sencrop sencrop.com Sencrop Case Study
OSINT Industries OSINT Industries osint.industries OSINT Industries Case Study
HGV HGV hgv.it HGV Case Study
Maxroll Maxroll maxroll.gg Maxroll Case Study
Zezam Zezam zezam.io Zezam Case Study
T.RowePrice T.RowePrice troweprice.com
Mistral Mistral mistral.ai
Axel Springer Axel Springer axelspringer.com
Hemnet Hemnet hemnet.se
Cisco Cisco cisco.com
Presidencia de la República Dominicana Presidencia de la República Dominicana presidencia.gob.do
Moonpig Moonpig moonpig.com
Booster Booster choosebooster.com
Zaptec Zaptec zaptec.com
Klarna Klarna klarna.com
Raspberry PI Foundation Raspberry PI Foundation raspberrypi.org
Tulip Tulip Retail tulip.com
Hootsuite Hootsuite hootsuite.com
Segment Segment segment.com
Arduino Arduino arduino.cc
Sainsbury's Sainsbury's sainsburys.co.uk
Contraste Contraste contraste.com
inMusic InMusic inmusicbrands.com
Buhta Buhta buhta.com
Amplitude amplitude.com amplitude.com
TIER IV Kyma Project Serlo Padis
Cloudbear Security Onion Solutions Factly All My Funds
Nortal OrderMyGear R2Devops Paralus
dyrector.io pinniped.dev pvotal.tech

Many thanks to all individual contributors

Ecosystem

We build Ory on several guiding principles when it comes to our architecture design:

Ory's architecture is designed to run best on a Container Orchestration system such as Kubernetes, CloudFoundry, OpenShift, and similar projects. Binaries are small (5-15MB) and available for all popular processor types (ARM, AMD64, i386) and operating systems (FreeBSD, Linux, macOS, Windows) without system dependencies (Java, Node, Ruby, libxml, ...).

Ory Kratos: Identity and User Infrastructure and Management

Ory Kratos is an API-first Identity and User Management system that is built according to cloud architecture best practices. It implements core use cases that almost every software application needs to deal with: Self-service Login and Registration, Multi-Factor Authentication (MFA/2FA), Account Recovery and Verification, Profile, and Account Management.

Ory Hydra: OAuth2 & OpenID Connect Server

Ory Hydra is an OpenID Certified™ OAuth2 and OpenID Connect Provider which easily connects to any existing identity system by writing a tiny "bridge" application. It gives absolute control over the user interface and user experience flows.

Ory Oathkeeper: Identity & Access Proxy

Ory Oathkeeper is a BeyondCorp/Zero Trust Identity & Access Proxy (IAP) with configurable authentication, authorization, and request mutation rules for your web services: Authenticate JWT, Access Tokens, API Keys, mTLS; Check if the contained subject is allowed to perform the request; Encode resulting content into custom headers (X-User-ID), JSON Web Tokens and more!

Ory Keto: Access Control Policies as a Server

Ory Keto is a policy decision point. It uses a set of access control policies, similar to AWS IAM Policies, in order to determine whether a subject (user, application, service, car, ...) is authorized to perform a certain action on a resource.

Documentation

The full Ory Hydra documentation is available at www.ory.com/docs/hydra, including:

For upgrading and changelogs, check releases tab and CHANGELOG.md.

Developing Ory Hydra

See DEVELOP.md for information on:

Security

OAuth2 and OAuth2 related specifications are over 400 written pages. Implementing OAuth2 is easy, getting it right is hard. Ory Hydra is trusted by companies all around the world, has a vibrant community and faces millions of requests in production each day. Read the security guide for more details on cryptography and security concepts.

Disclosing vulnerabilities

If you think you found a security vulnerability, please refrain from posting it publicly on the forums, the chat, or GitHub. You can find all info for responsible disclosure in our security.txt.

Telemetry

Our services collect summarized, anonymized data that can optionally be turned off. Click here to learn more.

Libraries and third-party projects

Official:

Community:

Developer Blog:

hydra (ory/hydra)

Searching Database…

17.6K ·GitHub
这是什么?Ory Hydra 是一个通过 OpenID 认证的 OAuth 2.0 和 OpenID Connect 服务器,用 Go 编写,负责签发和校验令牌、管理客户端,并处理登录与授权同意流程。既可以自托管,也可以作为 Ory Network 上的托管服务运行。
这是要加到我应用里的库,还是要部署的服务器?一个需要单独部署的服务器,通过 HTTP API 与它交互。它有意不包含用户管理功能——它是 OAuth2/OIDC 令牌引擎,而不是你的登录系统。
最快的上手方式是什么?安装 Ory CLI 并创建一个新项目——几分钟内就能跑通客户端凭证(Client Credentials)流程或授权码 + OpenID Connect 流程。要自托管的话,安装 Hydra 的二进制文件或 Docker 镜像即可。
除了二进制文件,它还需要什么才能运行?需要一个后端数据库:PostgreSQL、MySQL 或 CockroachDB。架构上它专为部署在 Kubernetes、CloudFoundry 或 OpenShift 这类容器编排平台上而设计。
既然它没有用户管理功能,登录到底是怎么实现的?Hydra 把身份认证委托给你已有的身份系统——Ory Kratos、authboss、User Frosting,或者你自己开发的系统——方式是通过你编写的一个小型的登录与授权同意“桥接”应用。这样你就能完全掌控界面和用户体验。
它能在我的笔记本上运行吗,还是只能在 Linux/Kubernetes 上用?它提供体积很小(5-15MB)的二进制文件,覆盖 ARM、AMD64 和 i386 架构,支持 Linux、macOS、Windows 和 FreeBSD,还有 Docker 镜像。不需要 Java、Node 或 Ruby 之类的系统依赖。
它会偷偷上报遥测数据吗?它会收集汇总后的匿名使用数据,而且这个功能可以关闭。
不开付费版,我能把开源版本用在生产环境吗?核心引擎基于 Apache-2.0 协议、免费使用,但 Ory 建议自托管无许可证版本仅用于试验和非关键业务。关键业务场景则需要付费的 Ory Enterprise License,以获得修复了 CVE 漏洞的版本、高级功能以及 SLA 支持。
为什么不自己实现 OAuth2 就好了?按照 README 的说法,OAuth2 规范系列超过 400 页书面内容,实现起来容易,但做对很难。Hydra 已通过 OpenID Foundation 的认证,覆盖 Basic、Implicit、Hybrid、Configuration 和 Dynamic OP 等配置文件,每天要应对数百万次生产环境请求。
Ory 生态的其他部分是什么样的?Kratos 是一个 API 优先的身份与用户管理服务(登录、注册、MFA/2FA、账号恢复),Oathkeeper 是一个 BeyondCorp/零信任身份与访问代理,Keto 提供类似 AWS IAM 的访问控制策略。每个都是独立组件,能和 Hydra 自然搭配使用。
都有谁在实际使用它?OpenAI、Klarna、Cisco、Mistral、Fandom、Hootsuite、Segment 等数千家公司。Ory 社区成员超过 50000 名,这套技术栈每天保护着超过 70 亿次 API 请求。
What are similar projects?zitadel, authentik, casdoor, kratos, logto, dex, oauth2-proxy, keycloak
Creator
ory
Size
123.2 MB
Stars
17.6K
Age
11y
Commits · 90 Days