Go to file
Philippe Gaultier 4f8ff8e2c4 test: fix multiple data races
GitOrigin-RevId: 1a5a43df500fe8ed49c8e7c08fb57e6b75155d91
2025-12-16 10:22:47 +00:00
.docker chore: bump Go everywhere 2025-09-08 14:21:58 +00:00
.github chore(deps): update actions/cache action to v5 2025-12-12 18:48:09 +00:00
.reports chore: npm security updates 2025-09-30 11:14:45 +00:00
.schema autogen: prepare for OSS release - v25.4.0 2025-11-07 12:17:35 +00:00
aead Merge branch 'fosite-monorepo' 2025-10-31 12:37:14 +00:00
client chore: fully implement provider pattern 2025-11-26 09:47:26 +00:00
cmd feat: improved tracing 2025-12-03 14:45:32 +00:00
consent chore: simplify consent store 2025-12-10 17:06:26 +00:00
contrib/quickstart feat: implement RFC 8628 (#3912) 2025-02-26 13:41:41 +01:00
cypress feat: implement RFC 8628 (#3912) 2025-02-26 13:41:41 +01:00
docs feat: stateless authorization code flow (#3515) 2023-06-12 20:27:00 +02:00
driver chore: simplify consent store 2025-12-10 17:06:26 +00:00
flow revert: simplify consent store 2025-12-09 10:53:52 +00:00
fosite test: fix multiple data races 2025-12-16 10:22:47 +00:00
fositex chore: fully implement provider pattern 2025-11-26 09:47:26 +00:00
health chore: simplify consent store 2025-12-09 09:33:00 +00:00
hsm chore: fix golangci-lint issues in Hydra 2025-12-04 17:20:45 +00:00
internal autogen(sdk): bump to 0747fafb24ad69bdee50488fdd1baa64a2988954 2025-12-08 15:39:13 +00:00
jwk chore: fully implement provider pattern 2025-11-26 09:47:26 +00:00
oauth2 test: fix multiple data races 2025-12-16 10:22:47 +00:00
oryx fix: x data race and parallize some tests 2025-12-05 16:48:11 +00:00
persistence chore: simplify consent store 2025-12-10 17:06:26 +00:00
scripts fix: implicit transactions for cockroach v23.5 and simplified migration logic 2025-10-29 07:57:24 +00:00
spec feat: full user-code configuration 2025-10-22 16:50:31 +00:00
test fix(deps): update dependency prettier to v3.7.4 2025-12-05 09:28:37 +00:00
x chore: simplify consent store 2025-12-09 09:33:00 +00:00
.cobra.yaml feat: custom client token ttl (#3206) 2022-07-28 21:12:09 +02:00
.codeclimate.yml feat: custom client token ttl (#3206) 2022-07-28 21:12:09 +02:00
.dockerignore feat: stateless authorization code flow (#3515) 2023-06-12 20:27:00 +02:00
.editorconfig chore: update version schema to be compatible with current ory/cli (#3211) 2022-08-01 17:59:09 +02:00
.gitattributes
.gitignore perf: add index to optimize jwt query 2025-06-03 17:47:45 +00:00
.goimportsignore
.golangci.yml chore: fix all hydra linter issues 2025-09-29 09:07:24 +00:00
.goreleaser.yml fix: improve docker set up (#3924) 2025-01-11 13:32:35 +01:00
.grype.yml feat: stateless authorization code flow (#3515) 2023-06-12 20:27:00 +02:00
.mailmap feat: add list of authors (#2831) 2021-11-16 20:01:38 +01:00
.nancy-ignore fix: remove explicit cve allowlist 2020-10-07 10:46:56 +02:00
.npmignore
.orycli.yml feat: render complete config schema during CI (#3433) 2023-02-09 11:15:29 +01:00
.prettierignore fix: failing CI in OSS repos 2025-08-22 11:17:04 +00:00
.reference-ignore chore: update repository templates to 852a1aece5 2022-11-01 20:07:52 +00:00
.trivyignore feat: stateless authorization code flow (#3515) 2023-06-12 20:27:00 +02:00
AUTHORS chore: list contributors in file (#3345) 2022-11-10 17:37:49 +01:00
CHANGELOG.md autogen: prepare for OSS release - v25.4.0 2025-11-07 12:17:35 +00:00
CODE_OF_CONDUCT.md chore: update repository templates to af28aff50b 2023-08-03 15:35:53 +00:00
CONTRIBUTING.md chore: update repository templates to bc603a639a 2025-03-12 16:12:38 +00:00
DEVELOP.md autogen(sdk): bump to 9c2abd78343503d5ad1cc4b7a815220c38dd59e0 2025-12-15 10:29:54 +00:00
LICENSE
MAINTAINERS
Makefile chore: add retries to more curl invocations 2025-11-21 18:00:16 +00:00
README.md autogen(sdk): bump to 9c2abd78343503d5ad1cc4b7a815220c38dd59e0 2025-12-15 10:29:54 +00:00
SECURITY.md chore: update repository templates to 1af2225678 2024-12-04 15:35:59 +00:00
UPGRADE.md refactor(sdk): consent SDK 2022-10-11 17:01:24 +02:00
codecov.yml fix: remove codecov report for internal testhelpers 2021-11-24 10:57:49 +01:00
cypress.json feat: OpenID Connect Dynamic Client Registration and OAuth2 Dynamic Client Registration Protocol (#2909) 2022-01-04 12:54:32 +02:00
doc.go docs: standardize license headers (#3216) 2022-11-03 10:10:12 -05:00
go.mod chore: simplify consent store 2025-12-09 09:33:00 +00:00
go.sum chore: simplify consent store 2025-12-09 09:33:00 +00:00
install.sh fix: always retry curl invocations to surmount transient third-party failures 2025-11-20 08:18:50 +00:00
main.go fix: append /v2 to module path 2023-01-28 08:40:41 +01:00
openapitools.json chore: update Hydra dependencies 2025-09-30 09:11:32 +00:00
package-lock.json chore: remove unused internal AXv2 ACL check API 2025-12-09 12:35:56 +00:00
package.json chore: more npm security updates 2025-11-21 17:34:28 +00:00
package.oc.json
quickstart-cockroach.yml fix: implicit transactions for cockroach v23.5 and simplified migration logic 2025-10-29 07:57:24 +00:00
quickstart-cors.yml fix: do not iteratively delete records (#3766) 2024-06-07 13:48:19 +02:00
quickstart-debug.yml fix: do not iteratively delete records (#3766) 2024-06-07 13:48:19 +02:00
quickstart-hsm.yml fix: do not iteratively delete records (#3766) 2024-06-07 13:48:19 +02:00
quickstart-jwt.yml fix: do not iteratively delete records (#3766) 2024-06-07 13:48:19 +02:00
quickstart-mysql.yml feat: upgrade to jackc/pgx/v5 (#3798) 2024-08-29 13:53:03 +00:00
quickstart-postgres.yml feat: upgrade to jackc/pgx/v5 (#3798) 2024-08-29 13:53:03 +00:00
quickstart-prometheus-config.yml feat: custom client token ttl (#3206) 2022-07-28 21:12:09 +02:00
quickstart-prometheus.yml fix: do not iteratively delete records (#3766) 2024-06-07 13:48:19 +02:00
quickstart-tracing.yml fix: do not iteratively delete records (#3766) 2024-06-07 13:48:19 +02:00
quickstart.yml autogen: prepare for OSS release - v25.4.0 2025-11-07 12:17:35 +00:00

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:

  • OAuth 2.0 and OpenID Connect flows
  • Token issuance and validation
  • Client management
  • Consent and login flow orchestration
  • JWKS management
  • Low latency and high throughput

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:

  • Be a standalone OAuth 2.0 and OpenID Connect server without user management
  • Connect to any existing identity provider through a login and consent app
  • Give you absolute control over the user interface and experience flows
  • Work with any authentication endpoint: Ory Kratos, authboss, User Frosting, or your proprietary system
  • Scale to large numbers of clients and tokens
  • Fit into modern cloud native environments such as Kubernetes and managed platforms

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:

  • As a managed service on the Ory Network
  • As a self hosted service under your own control, with or without the Ory Enterprise License

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:

  • OAuth2 and OpenID Connect for single sign on, API access, and machine to machine authorization
  • Identity and credential management that scales to billions of users and devices
  • Registration, login, and account management flows for passkeys, biometrics, social login, SSO, and multi factor authentication
  • Prebuilt login, registration, and account management pages and components
  • Low latency permission checks based on the Zanzibar model with the Ory Permission Language
  • GDPR friendly storage with data locality and compliance in mind
  • Web based Ory Console and Ory CLI for administration and operations
  • Cloud native APIs compatible with the open source servers
  • Fair, usage based pricing

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:

  • Install Hydra on Linux, macOS, Windows, and Docker
  • Configure databases such as PostgreSQL, MySQL, and CockroachDB
  • Deploy to Kubernetes and other orchestration systems
  • Build Hydra from source

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:

  • Additional enterprise features that are not available in the open source version
  • Regular security releases, including CVE patches, with service level agreements
  • Support for advanced scaling, multi-tenancy, and complex deployments
  • Premium support options with SLAs, direct access to engineers, and onboarding help
  • Access to a private Docker registry with frequent and vetted, up-to-date enterprise builds

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 office@ory.sh 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:

  • Minimal dependencies
  • Runs everywhere
  • Scales without effort
  • Minimize room for human and network errors

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.sh/docs/hydra, including:

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

Developing Ory Hydra

See DEVELOP.md for information on:

  • Contribution guidelines
  • Prerequisites
  • Install from source
  • Running tests
  • Build Docker image
  • Preview API documentation

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:

  • Visit the Ory Blog for guides, tutorials and articles around Ory Hydra and the Ory ecosystem.