OAuth2 server with OpenID Connect - cloud native, security-first, open source API security for your infrastructure. Written in Go.
Go
Latest commit c94ba07 Jul 11, 2017 @arekkas arekkas docs: update readme
Permalink
Failed to load latest commit information.
.docker-home πŸ”₯ 0.1-beta πŸ”₯ May 29, 2016
client oauth2: form-urldecode authorization basic header (#537) Jun 22, 2017
cmd cq: gofmt -w -s Jul 6, 2017
compose cq: gofmt -w -s Jul 6, 2017
config cq: gofmt -w -s Jul 6, 2017
docs vendor: resolve logrus case mess Jul 6, 2017
firewall all: goimports May 7, 2017
health cq: gofmt -w -s Jul 6, 2017
integration cq: gofmt -w -s Jul 6, 2017
jwk all: export test helpers (#518) Jun 14, 2017
metrics cq: gofmt -w -s Jul 6, 2017
oauth2 oauth2: give meaningful hint when subject claim is empty (#554) Jul 9, 2017
pkg cq: gofmt -w -s Jul 6, 2017
policy vendor: update to ladon 0.8.0 - closes #503 (#528) Jun 17, 2017
rand vendor: update to latest versions Jun 4, 2017
sdk metrics: add metrics and telemetry package (#500) Jun 7, 2017
warden warden: resolve broken import Jul 6, 2017
.cobra.yaml πŸ”₯ 0.1-beta πŸ”₯ May 29, 2016
.codeclimate.yml πŸ”₯ 0.1-beta2 (#90) πŸ”₯ Jun 14, 2016
.dockerignore docs: update five minute tutorial Dec 30, 2016
.gitignore all: add ability to load database connectors from plugins Jun 15, 2017
.travis.yml all: export test helpers (#518) Jun 14, 2017
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Jun 29, 2017
CONTRIBUTING.md docs: update badges, install guide and tutorial (#545) Jun 30, 2017
Dockerfile all: add ability to load database connectors from plugins Jun 15, 2017
Dockerfile-automigrate all: add ability to load database connectors from plugins Jun 15, 2017
Dockerfile-demo all: add ability to load database connectors from plugins Jun 15, 2017
Dockerfile-http all: add ability to load database connectors from plugins Jun 15, 2017
Dockerfile-without-telemetry all: add ability to load database connectors from plugins Jun 15, 2017
HISTORY.md metrics: add metrics and telemetry package (#500) Jun 7, 2017
ISSUE_TEMPLATE.md Update ISSUE_TEMPLATE.md Jun 29, 2017
LICENSE Update LICENSE Oct 26, 2015
MAINTAINERS doc: create MAINTAINERS Dec 30, 2015
PULL_REQUEST_TEMPLATE.md Update PULL_REQUEST_TEMPLATE.md Jun 29, 2017
Procfile πŸ”₯ 0.1-beta πŸ”₯ May 29, 2016
README.md docs: update readme Jul 11, 2017
book.json 0.4.0 (#203) Aug 17, 2016
doc.go docs: update to latest go-swagger compatibility Jun 14, 2017
doc_swagger.go metrics: add metrics and telemetry package (#500) Jun 7, 2017
docker-compose.yml docs: update badges, install guide and tutorial (#545) Jun 30, 2017
gen-swagger.sh docs: add swagger docs for the client endpoint May 7, 2017
glide.lock vendor: update glide lock Jul 6, 2017
glide.yaml warden: refresh tokens are no longer proof of authZ Jul 6, 2017
main.go docs: add swagger docs for the client endpoint May 7, 2017

README.md

ORY Hydra

Join the chat at https://gitter.im/ory-am/hydra Join the community at https://community.ory.am/ Join newsletter Become a patron!

Build Status Coverage Status Code Climate Go Report Card CII Best Practices

Docs Guide HTTP API Documentation Code Documentation

ORY Hydra is a hardened OAuth2 and OpenID Connect server optimized for low-latency, high throughput, and low resource consumption. ORY Hydra is not an identity provider (user sign up, user log in, password reset flow), but connects to your existing identity provider through a consent app. Implementing the consent app in a different language is easy, and exemplary consent apps (Go, Node) and SDKs (Go, Node) are provided.

Besides mitigating various attack vectors, such as database compromisation and OAuth 2.0 weaknesses, ORY Hydra is able to securely manage JSON Web Keys, and has a sophisticated policy-based access control you can use if you want to. Click here to read more about security.


Table of Contents

What is ORY Hydra?

ORY Hydra is a server implementation of the OAuth 2.0 authorization framework and the OpenID Connect Core 1.0. Existing OAuth2 implementations usually ship as libraries or SDKs such as node-oauth2-server or fosite, or as fully featured identity solutions with user management and user interfaces, such as Dex.

Implementing and using OAuth2 without understanding the whole specification is challenging and prone to errors, even when SDKs are being used. The primary goal of ORY Hydra is to make OAuth 2.0 and OpenID Connect 1.0 better accessible.

ORY Hydra implements the flows described in OAuth2 and OpenID Connect 1.0 without forcing you to use a "Hydra User Management" or some template engine or a predefined front-end. Instead it relies on HTTP redirection and cryptographic methods to verify user consent allowing you to use ORY Hydra with any authentication endpoint, be it authboss, auth0.com or your proprietary PHP authentication.

OAuth2 and OpenID Connect: Open Standards!

ORY Hydra implements Open Standards set by the IETF:

and the OpenID Foundation:

ORY API Security

ORY API Security is a popular, hardened toolbox of open and closed source services for securing your APIs and web services. Our products are capable of handling high throughput with low latency, work flawlessly in the cloud and on premise, and are securing millions of requests each day already.

Products

ORY Security Console

  • ORY Hydra - this repository.
  • ORY Hydra+ is optimized for extreme production loads, resiliance and availability - learn more now.
  • ORY Security Console (image on the right) is an admin user interface for ORY Hydra and ORY Gatekeeper. Available on-premise and as a service - learn more now.
  • ORY Gatekeeper is a configurable firewall reverse proxy making access control easy and secure. ORY Gatekeeper is compatible with ORY Hydra Access Control Policies and OAuth 2.0 Access Tokens. Learn more now.
  • ORY Fosite is a popular open source OAuth2 and OpenID Connect SDK for Go.
  • ORY Ladon is an acclaimed open source SDK for access control policies, solving authorization in the microservice and IoT age.

Consulting

Access Control, OAuth 2.0, and OpenID Connect are rich topics with many nuances and implementation details. Not to worry, because we offer consulting services both on these topics and our ORY API Security products.

We are not your typical enterprise partner, but an agile, polite, highly talented, and extremely productive team of technology experts. You will never talk with interns, out-sourced support staff, or bots - but always with the owners and maintainers of the respective products, or even the founders themselves.

Go here to learn more about our consulting services.

Quickstart

This section is a quickstart guide to working with ORY Hydra. In-depth docs are available as well:

  • The documentation is available on GitBook.
  • The REST API documentation is available at Apiary.

5 minutes tutorial: Run your very own OAuth2 environment

The tutorial teaches you to set up ORY Hydra, a Postgres instance and an exemplary identity provider written in React using docker compose. It will take you about 5 minutes to complete the tutorial.

OAuth2 Flow


Installation

There are various ways of installing ORY Hydra on your system.

Download binaries

The client and server binaries are downloadable at releases. There is currently no installer available. You have to add the ORY Hydra binary to the PATH environment variable yourself or put the binary in a location that is already in your path (/usr/bin, ...). If you do not understand what that all of this means, ask in our chat channel. We are happy to help.

Using Docker

Starting the host is easiest with docker. The host process handles HTTP requests and is backed by a database. Read how to install docker on Linux, OSX or Windows. ORY Hydra is available on Docker Hub.

You can use ORY Hydra without a database, but be aware that restarting, scaling or stopping the container will lose all data:

$ docker run -e "DATABASE_URL=memory" -e "ISSUER=https://localhost:4444/" -d --name my-hydra -p 4444:4444 oryd/hydra
ec91228cb105db315553499c81918258f52cee9636ea2a4821bdb8226872f54b

Note: We had to create a new docker hub repository. Tags prior to 0.7.5 are available here.

Using the client command line interface: You can ssh into the ORY Hydra container and execute the ORY Hydra command from there:

$ docker exec -i -t <hydra-container-id> /bin/sh
# e.g. docker exec -i -t ec91228 /bin/sh

root@ec91228cb105:/go/src/github.com/ory/hydra# hydra
Hydra is a twelve factor OAuth2 and OpenID Connect provider

[...]

Building from source

If you wish to compile ORY Hydra yourself, you need to install and set up Go 1.8+ and add $GOPATH/bin to your $PATH. To do so, run the following commands in a shell (bash, sh, cmd.exe, ...):

go get -d -u github.com/ory/hydra
go get github.com/Masterminds/glide
cd $GOPATH/src/github.com/ory/hydra
glide install
go install github.com/ory/hydra
hydra

Notes

  • We changed organization name from ory-am to ory. In order to keep backwards compatibility, we did not rename Go packages.
  • You can ignore warnings similar to package github.com/ory/hydra/cmd/server: case-insensitive import collision: "github.com/Sirupsen/logrus" and "github.com/sirupsen/logrus".

Security

Why should I use ORY Hydra? It's not that hard to implement two OAuth2 endpoints and there are numerous SDKs out there!

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. Of course, we also compiled a security guide with more details on cryptography and security concepts. Read the security guide now.

Telemetry

ORY Hydra collects summarized, anonymized telemetry which can optionally be turned off. Click here to learn more.

Sponsors & Adopters

ORY Hydra is open source with a permissive license. We are a dedicated, young but also experienced team of developers in the area of cloud computing and internet security. Please support our mission for a safer web and become a sponsor, buy an engineer membership, or tell us why and how you are using ORY Hydra.

Sponsorship

Become a ORY Hydra sponsor now and help keep the project open source, free, and maintained. Additionally, sponsors unlock

  • Access to ORY's private slack community.
  • Featured logo & link in the readme and on the website.
  • placement in release announcements.

Sponsorship starts at 600$ per month. We accept smaller contributions as well, but without the benefits listed above.

Sponsors

Auth0.com

We are proud to have Auth0 as a gold sponsor for ORY Hydra. Auth0 solves the most complex identity use cases with an extensible and easy to integrate platform that secures billions of logins every year. At ORY, we use Auth0 in conjunction with ORY Hydra for various internal projects.


Adopters

ORY Hydra is battle-tested in production systems. This is a curated list of ORY Hydra adopters. Tell us if you think that your company should be listed here.

arduino.cc

Arduino is an open-source electronics platform based on easy-to-use hardware and software. It's intended for anyone making interactive projects. ORY Hydra secures Arduino's developer platform.


Documentation

Guide

The Guide is available on GitBook.

HTTP API documentation

The HTTP API is documented at Apiary.

Command line documentation

Run hydra -h or hydra help.

Develop

Developing with ORY Hydra is as easy as:

go get -d -u github.com/ory/hydra
go get github.com/Masterminds/glide
cd $GOPATH/src/github.com/ory/hydra
glide install
go test $(glide novendor)

Then run it with in-memory database:

DATABASE_URL=memory go run main.go host

Notes

  • We changed organization name from ory-am to ory. In order to keep backwards compatibility, we did not rename Go packages.
  • You can ignore warnings similar to package github.com/ory/hydra/cmd/server: case-insensitive import collision: "github.com/sirupsen/logrus" and "github.com/sirupsen/logrus".

Reception

Hydra has received a lot of positive feedback. Let's see what the community is saying:

Nice! Lowering barriers to the use of technologies like these is important.

Pyxl101

OAuth is a framework not a protocol. The security it provides can vary greatly between implementations. Fosite (which is what this is based on) is a very good implementation from a security perspective: https://github.com/ory/fosite#a-word-on-security

abritishguy

[...] Thanks for releasing this by the way, looks really well engineered. [...]

Libraries and third-party projects

Official:

Community:

Blog posts & articles