Commit Graph

92 Commits

Author SHA1 Message Date
hackerman 95a51deb31
Improve configuration and service management (#1314)
This patch significantly refactors internal configuration and service management with the goal of making configuration changes possible without service restarts. This patch prepares the possibility to configure ORY Hydra from a remote source (etcd, consul) and watch for changes. This patch also introduces the possibility to configure ORY Hydra from a configuration file on top of environment variables.

The following issues have been fixed as well:

- Key rotation of the system secret is now much simpler (closes #1316)
- Database connectivity parameters such as max_conns no longer cause issues with older postgres versions (closes #1327)
- Non-existing routes now return a JSON error instead of `text/plain` when `application/json` was requested (clsoes #1244)
- We now push tags latest, X, X.Y, X.Y.Z to docker hub (closes #1289)
- The quickstart guide no longer builds the source code but instead pulls latest tag (closes #1309)
- We moved to goreleaser and godownloader for release management (closes #1107)
- The quickstart Docker Compose files are now reusable (closes #1196)

The following issues are also resolved:

- Closes #1121 

Signed-off-by: aeneasr <aeneas@ory.sh>
2019-04-02 11:52:21 +02:00
hackerman 328d6178db
e2e: Add e2e tests checking consistency (#1184)
Signed-off-by: aeneasr <aeneas@ory.sh>
2018-11-21 14:55:50 +01:00
hackerman 11924bf5f7
sql: Resolve index/fk regression issues (#1178)
Closes #1177

Signed-off-by: aeneasr <aeneas@ory.sh>
2018-11-20 00:02:05 +01:00
arekkas 700a4a2eff sdk: Use new api groups everywhere 2018-11-18 23:04:10 +01:00
hackerman ddafef543c
oauth2: Make client registration endpoint configurable (#1167)
Closes #1072
2018-11-08 17:12:32 +01:00
hackerman 4a8cf84f15
cmd: Add ability to specify consent and login lifespan (#1155)
Closes #1057
2018-11-03 21:15:59 +01:00
hackerman 3a10df9bff
oauth2: Add OAuth2 audience claim and improve migrations (#1145)
This patch adds the ability to whitelist and request an audience
when performing any OAuth 2.0 Flow. The audience is useful in multi-
tenant environments where access tokens should be restricted to certain
resources.

Closes #883
Closes #1144

Signed-off-by: arekkas <aeneas@ory.am>
2018-11-02 16:46:01 +01:00
hackerman 65b7406abe
Move dependencies to ory/x (#1095)
Signed-off-by: aeneasr <aeneas@ory.sh>
2018-10-23 06:59:31 -07:00
Amir Aslaminejad 404bdd711f jwk: update manager to take in context and update all consumers
Signed-off-by: Amir Aslaminejad <aslaminejad@gmail.com>
2018-09-18 09:48:55 +02:00
hackerman a36d0af611
oauth2: Enable client specific CORS settings (#1009)
Field `allowed_cors_origins` was added to OAuth 2.0 Clients. It enables
CORS for the whitelisted URLS for paths which clients interact with,
such as /oauth2/token.

Closes #975

Signed-off-by: arekkas <aeneas@ory.am>
2018-08-26 14:28:05 +02:00
arekkas 479acd7ea7 consent: Introduce pairwise support
This patch introduces the OpenID Connect pairwise Subject Identifier Algorithm.

Closes #950

Signed-off-by: arekkas <aeneas@ory.am>
2018-08-10 10:23:19 +02:00
arekkas f32c97e844 cmd: Fix 2-port tests and improve upgrade guide
Signed-off-by: arekkas <aeneas@ory.am>
2018-08-06 11:29:38 +02:00
arekkas cfee3eb3d0 cmd: Introduce public and administrative ports
This patch introduces two ports, public and administrative. The public
port is responsible for handling API requests to public endpoints such
as /oauth2/auth, while the administrative port handles requests to
JWK, OAuth 2.0 Client, and Login & Consent endpoints.

Closes #904

Signed-off-by: arekkas <aeneas@ory.am>
2018-08-06 11:29:38 +02:00
arekkas a8b9b022d9 client: Deprecate field `id`, now only `client_id` is to be used
Signed-off-by: arekkas <aeneas@ory.am>
2018-07-23 17:10:30 +02:00
arekkas c932ab4571 oauth2: Adds JWT Access Token strategy
This patch adds the (experimental) ability to issue JSON Web Tokens instead of ORY Hydra's opaque access tokens. Please be aware that this feature has had little real-world and unit testing and may not be suitable for production.

Simple integration tests using the JWT strategy have been added to ensure functionality.

To use the new JWT strategy, set environment variable `OAUTH2_ACCESS_TOKEN_STRATEGY` to `jwt`. For example: `export OAUTH2_ACCESS_TOKEN_STRATEGY=jwt`.

Please be aware that we (ORY) do not recommend using the JWT strategy for various reasons. If you can, use the default and recommended "opaque" strategy instead.

Closes #248

Signed-off-by: arekkas <aeneas@ory.am>
2018-07-23 17:10:30 +02:00
arekkas 04929d0250 oauth2: Adds userinfo tests 2018-06-24 17:24:12 +02:00
arekkas bc0b54c545 oauth2: Implements userinfo response signing 2018-06-24 17:24:12 +02:00
arekkas e41fcf263c jwk: Removes buggy rotate command and improves jwk refresh 2018-06-24 17:24:12 +02:00
arekkas 1d02cae554 jwk: Implements proper refreshing strategy 2018-06-24 17:24:12 +02:00
aeneasr 6837046546 oauth2: Declares grant type refresh_token as supported 2018-06-24 17:24:12 +02:00
arekkas 8f2e9314f2 oauth2: Exposes proper oidc configuration 2018-06-24 17:24:12 +02:00
arekkas 259d63a4de oauth2: Adds private_key_jwt authentication method 2018-06-24 17:24:12 +02:00
arekkas ffefb74e06 oauth2: Resolves well-known test issues 2018-06-24 17:24:12 +02:00
arekkas a7edf63cbc oauth2: Trim left slash from userinfo endpoint 2018-05-19 22:44:39 +02:00
arekkas 1940c3c8ff oauth2: Properly uses issuer in JWT 2018-05-19 22:39:01 +02:00
arekkas aa01423521 oauth2: Resolves broken well-known test 2018-05-19 22:06:23 +02:00
arekkas a002e30577 oauth2: Improves the consent flow design
This patch makes significant changes to the consent flow. First,
the consent flow is being renamed to "User Login and Consent Flow"
and is split into two redirection flows, the "User Login Redirection Flow"
and the "User Consent Flow".

Conceptually, not a lot has changed but the APIs have been cleaned up
and the new flow is a huge step towards OpenID Connect Certification.

Besides easier implementation on the (previously known as) consent app,
this patch introduces a new set of features which lets ORY Hydra
detect previous logins and previously accepted consent requests. In turn,
the user does not need to login or consent on every OAuth2 Authorize Code
Flow.

This patch additionally lays the foundation for revoking tokens per
user or per user and client.

Awesome.

Closes #771
Closes #772
2018-05-04 14:07:36 +02:00
arekkas 3d0bf0bda5 Removes policy, warden and groups from this project
We have learned a lot over the last year in terms of how ORY Hydra is being used. Initially, we wanted to avoid the problems facing popular databases like MongoDB or others, which did not include authentication for their management APIs.

For this reason, the Warden API was born and primarily used internally and exposed via HTTP. We learned that access control policies are well received, but also add additional complexity to understanding the software. While we firmly believe that these policies implement best practices for access control in complex systems, we do understand that they add a barrier to getting started with ORY Hydra.

For this reason we are planning on moving the Warden API from this project to ORY Oathkeeper or potentially it's own server. We would add a migration path for existing policy definitions to the new service. The default docker image would combine the services in such a way, that ORY Hydra is protected. We would additionally have an (insecure) docker image without authentication which can be used for testing.

This also opens up the possibility of having more access control mechanisms than access control policies. For example, we can add ACL and RBAC and other mechanisms too.

First I think it makes good sense to move this functionality into a separate service and remove the warden calls internally completely. The reason being that not everyone wants to rely on Hydra's access control. Sometimes it's enough to use a gateway in front and require e.g. an API key for management or whatever. New adopters are always baffled by complexity involved with policies and scopes. Removing that from the core could really help. The user survey has also shown that this stuff is quite complex to grasp.

The idea is to have a separate service which is basically ladon as a HTTP API. I think it makes sense to add some functionality to resolve access tokens so it would basically be very similar to the current warden API - probably even equal. There would definitely be some backup mode where hydra's database tables and migrations are used as to make migration as easy as possible.

Then, we would ship docker images and example set ups where different configurations are shown. One of the configurations would be the current one, so basically what we have now in hydra but with the three services combined in one image.

Closes #807
2018-04-29 18:25:42 +02:00
Aeneas 366ed57d9c
all: Updates license headers (#793) 2018-03-08 10:27:18 +01:00
arekkas ed0aa28c58 oauth2: Adds ability to flush old access tokens
Previously, no way of removing old access tokens from the database.
This patch adds a new endpoint (`POST /oauth2/flush`) capable of
flushing old / stale access tokens.

Additionally, `hydra token flush` was added which is the CLI command
for flushing tokens using the api.

Closes #738
2018-02-06 16:49:23 +01:00
arekkas cba05b496c oauth2: Adds list of supported auth methods to OIDC discovery
Closes #695
2017-12-14 19:25:43 +01:00
arekkas 34c5f30fd4 oauth2: Adds ability to configure OIDC Discovery 2017-12-09 23:39:34 +01:00
arekkas fabee0dcaf oauth2: Adds userinfo endpoint and improves OIDC discovery 2017-12-09 18:13:01 +01:00
Aeneas dcbd6d8fcb
Add license header to all source files (#644)
Closes #643
2017-11-06 13:01:53 +01:00
aeneasr 0b34388395 vendor: update to jwk-go 0.3 and replace glide with dep
Closes #631
2017-10-25 22:49:53 +02:00
arekkas fc3ee34e68 oauth2: replace jwk-based with http-based consent flow
Closes #578
2017-10-05 18:12:34 +02:00
arekkas 57fdfe95ea all: ran gofmt and goimports 2017-10-05 18:12:34 +02:00
arekkas d0a7e775ad vendor: update to fosite 0.11.0
* oauth2: improves warning when subject claim is empty in id token - closes #460
* oauth2: changes scope semantics to wildcard - closes #550
* oauth2: refresh openid connect id token via refresh_token grant - closes #556
2017-10-05 18:12:34 +02:00
arekkas 13c6915a00 cq: gofmt -w -s 2017-07-06 18:46:36 +02:00
aeneasr b480a3ea2e vendor: resolve logrus case mess 2017-07-06 18:46:36 +02:00
Wyatt Anderson 688103c7ff oauth2: use issuer-prefixed auth URL in challenge redirect (#509)
In order to support running Hydra with a different path prefix behind
a proxy, issue a challenge token with an issuer-prefixed auth redirect
URL instead of the URL received with the auth request.

Signed-off-by: Wyatt Anderson <wanderson@gmail.com>
2017-06-14 16:54:37 +02:00
Patrick Barker 3769676d48 oauth2: adds /.well-known/openid-configuration - closes #379
Signed-off-by: pbarker <pbarker@datapipe.com>
2017-05-10 09:12:16 +02:00