Commit Graph

92 Commits

Author SHA1 Message Date
Patrik a47e39513f
test: parallelize and improve (#3989) 2025-05-15 15:24:56 +02:00
Jeff Hickman 5baca2843a
feat: add handler for /.well-known/oauth-authorization-server. (#3980)
In order to support OAuth2.1 and some specific integrations that
leverage the `/.well-known/oauth-authorization-server` endpoint, this PR
adds a handler for the specific endpoint. The
`/.well-known/openid-configuration` endpoint already supports all
configuration items that conform to this endpoint as seen here:
https://datatracker.ietf.org/doc/html/rfc8414
2025-04-28 10:31:53 +02:00
hackerman 0a6c966206
feat: handle concurrent refreshes and improve graceful refreshing (#3895)
This patch improves Ory Hydra's ability to deal with refresh flows which, for example, concurrently refresh the same token. Furthermore, graceful token refresh has been improved to handle a variety of edge cases and scenarios.

Additionally, serializability errors in CockroachDB are now correctly retried.

See https://github.com/ory-corp/cloud/issues/7311
Closes https://github.com/ory/hydra/pull/3895
2024-12-17 09:57:05 +01:00
Patrik 477abaeb7d
chore: bump dependencies and generate internal SDK aligned with the published SDK (#3807) 2024-07-31 13:26:57 +02:00
Patrik 5dd7d306ba
feat: re-enable legacy client IDs (#3628)
This patch changes the primary key of the `hydra_client` table. We do not expect issues, as that table is probably not overly huge in any deployment. We do however highly recommend to test the migration performance on a staging environment with a similar database setup.
2023-09-19 11:20:23 +02:00
Henning Perl f29fe3af97
feat: stateless authorization code flow (#3515)
This patch optimizes the performance of authorization code grant flows by minimizing the number of database queries. We acheive this by storing the flow in an AEAD-encoded cookie and AEAD-encoded request parameters for the authentication and consent screens. 

BREAKING CHANGE:

* The client that is used as part of the authorization grant flow is stored in the AEAD-encoding. Therefore, running flows will not observe updates to the client after they were started.
* Because the login and consent challenge values now include the AEAD-encoded flow, their size increased to around 1kB for a flow without any metadata (and increases linearly with the amount of metadata). Please adjust your ingress / gateway accordingly.
2023-06-12 20:27:00 +02:00
Arne Luenser f56e5fad74 fix: append /v2 to module path 2023-01-28 08:40:41 +01:00
Arne Luenser 488f930e4f fix: clean up unused code 2023-01-28 08:40:41 +01:00
hackerman c54b9dbf9a
fix: add v2 suffix (#3340) 2022-11-05 17:53:04 +02:00
Kevin Goslar d768cf6580
docs: standardize license headers (#3216) 2022-11-03 10:10:12 -05:00
aeneasr 142b55f295 refactor(sdk): OAuth2 SDK API
BREAKING CHANGE: SDK naming has changed for the following operations:

```patch
ory.
-   V0alpha2Api.AdminDeleteOAuth2Token(context.Background()).
+   OAuth2Api.DeleteOAuth2Token(context.Background()).
    ClientId("foobar").Execute()

ory.
-   V0alpha2Api.RevokeOAuth2Token(
+   OAuth2Api.RevokeOAuth2Token(
        context.WithValue(context.Background(), sdk.ContextBasicAuth, sdk.BasicAuth{
            UserName: clientID,
            Password: clientSecret,
        })).Token(token).Execute()

ory.
-   V0alpha2Api.AdminIntrospectOAuth2Token(context.Background()).
+   OAuth2Api.IntrospectOAuth2Token(context.Background()).
    Token(token).
    Scope("foo bar")).Execute()
```
2022-10-11 17:01:24 +02:00
Ferdynand Naczynski ac279c38f7 chore: change metric name and make Go 1.19 compatible (#3223) 2022-09-07 08:10:31 +02:00
aeneasr a364db4ff2 fix: move to v0alpha2 api spec 2022-09-07 08:10:31 +02:00
aeneasr 937e6baabf fix: resolve internal SDK regressions 2022-09-07 08:10:31 +02:00
aeneasr c12b45cc44 refactor(oauth2): clean up changes 2022-09-07 08:10:31 +02:00
Grant Zvolsky 0752721dd8 refactor(client): rename SDK methods and introduce `/admin` prefix
BREAKING CHANGE: This release updates SDK services from `public` and `admin` to `v2`. Methods exposed at the admin interface are now prefixed with `admin` (e.g. `adminCreateOAuth2Client`). Administrative endpoints now have an `/admin` prefix (e.g. `POST /admin/clients`). Existing administrative endpoints will redirect to this new prefixed path for backwards compatibility.
2022-09-07 08:10:31 +02:00
aeneasr 17c226cc2a refactor: remove `/oauth2/flush` endpoint
BREAKING CHANGE: HTTP endpoint `/oauth2/flush`, used to flush inactive access token was deprecated and has been removed. Please use `hydra janitor` instead.
2022-09-07 08:10:31 +02:00
aeneasr 4002224439 refactor(client): make OAuth2 Client IDs system-chosen and immutable
BREAKING CHANGE: To improve security and scalability (in particular sharding), OAuth 2.0 Client IDs can no longer be chosen but are always assigned a random generated UUID V4. OAuth 2.0 Clients created with custom IDs before the v2.0 release will continue working with their legacy Client ID in Ory Hydra v2.x.

Additionally, the `hydra create client` command no longer supports flag `--id` and flag `--callbacks` has been renamed to `--redirect-uris`.

Closes #2911
2022-09-07 08:10:31 +02:00
aeneasr 2ef71d9756 chore: format 2022-09-07 08:10:31 +02:00
aeneasr 8db9e5bb23 test(hsm): resolve test issues 2022-09-07 08:10:31 +02:00
aeneasr bbe0406df6 feat: config hot reloading architecture 2022-09-07 08:10:31 +02:00
Grant Zvolsky 8e961d0eb3 code review 2022-09-07 08:10:31 +02:00
Grant Zvolsky 00490cbbc5 code review: generate first NID randomly; add/update tests; fix db-diff 2022-09-07 08:10:31 +02:00
Grant Zvolsky b7fc2bff53 feat: implement NID 2022-09-07 08:10:31 +02:00
Mart Aarma 7578aa9f3a
feat: Hardware Security Module support (#2625)
This change introduces support for Hardware Security Modules, a physical computing device that safeguards and manages digital keys, performs encryption and decryption functions for digital signatures, strong authentication, and other cryptographic functions.

If enabled, the Hardware Security Module is used to look up any keys. If no key is found, the software module is used as a fallback for lookup. This allows you to use the HSM for privileged keys, and the software module to manage lifecycle keys (e.g. for Token Exchange).

For more information, please [read the guide](https://www.ory.sh/hydra/docs/next/guides/hsm-support).

Thank you to [aarmam](https://github.com/aarmam) for this great contribution!

Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
2022-01-11 16:33:22 +01:00
George Bolo 96931685da
fix: add RFC 8414 pkce info to OpenID Connect Discovery (#2547)
Closes #2311
2021-06-03 09:34:24 +02:00
aeneasr a27b057517 autogen(docs): generate and format documentation 2021-05-31 15:30:58 +00:00
Nestor 5bdc4bc156
refactor: integrate with fosite `v0.40` (go-jose migration) (#2526)
Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
2021-05-31 18:01:28 +03:00
Mitar 8c703945e9
fix: audience should include client ID (#2455) 2021-05-14 15:33:57 +02:00
Mitar f701b28eaa
fix: WWW-Authenticate header in userinfo handler (#2454) 2021-05-14 15:24:39 +02:00
Alano Terblanche f039ebbdf3
feat: flush inactive/expired login and consent requests (#2381)
This patch resolves various table growth issues caused by expired/inactive login and consent flows never being purged from the database.

You may now use the new `hydra janitor` command to remove access & refresh tokens and login & consent requests which are no longer valid or used. The command follows the `notAfter` safe-guard approach to ensure records needed to be kept are not deleted.

To learn more, please use `hydra help janitor`.

This patch phases out the `/oauth2/flush` endpoint as the janitor is better suited for background tasks, is easier to run in a targeted fashion (e.g. as a singleton job), and does not cause HTTP timeouts.

Closes #1574
2021-03-24 20:58:44 +01:00
naveenpaul1 b46a14cd6d
feat: flush refresh tokens for service oauth2/flush (#2373)
See https://github.com/ory/hydra/issues/1574#issuecomment-736684327

Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com>
2021-03-08 12:43:18 +01:00
hackerman 4937a00b9a
fix: bump ory/x and update config usage (#2248) 2020-12-15 13:55:30 +01:00
aeneasr 428df22c7f chore: clean up viper mentions 2020-12-02 13:37:05 +01:00
aeneasr 8c12b27a59 refactor: replace viper with koanf config management
BREAKING CHANGES: After battling with [spf13/viper](https://github.com/spf13/viper) for several years we finally found a viable alternative with [knadh/koanf](https://github.com/knadh/koanf). The complete internal configuration infrastructure has changed, with several highlights:

1. Configuration sourcing works from all sources (file, env, cli flags) with validation against the configuration schema, greatly improving developer experience when changing or updating configuration.
2. Configuration reloading has improved significantly and works flawlessly on Kubernetes.
3. Performance increased dramatically, completely removing the need for a cache layer between the configuration system and ORY Hydra.
4. It is now possible to load several config files using the `--config` flag.
5. Configuration values are now sent to the tracer (e.g. Jaeger) if tracing is enabled.

Please be aware that deprecated configuration flags have finally been removed with this change. It is also possible that ORY Hydra might complain about an invalid configuration, because the validation process has improved significantly.
2020-12-02 13:37:05 +01:00
aeneasr d0697fab29 fix: add required aud, jti claims to userinfo response 2020-11-17 17:25:54 +01:00
aeneasr 4220959c02 feat: add new `request_object_signing_alg_values_supported` to oidc discovery 2020-11-17 17:25:54 +01:00
aeneasr bb8b9824e8 feat: add ability to override oidc discovery urls
Added config options `webfinger.oidc_discovery.token_url`, `webfinger.oidc_discovery.auth_url`, `webfinger.oidc_discovery.jwks_url`.
2020-11-17 17:25:54 +01:00
Patrik 7662917015
fix: client update breaks primary key (#2150)
Closes #2148
2020-10-29 15:06:45 +01:00
Patrik 56bce678cb refactor: use gobuffalo/pop for SQL abstraction (#2059)
This patch replaces the existing SQL and memory managers with a pop based persister. Existing SQL migrations are compatible as they have been migrated to the new SQL abstraction in version 1.7.x. As a goodie, ORY Hydra now supports SQLite for both in-memory as well as on-disk (useful for development and very small deployments) databases!

Closes #1730

Co-authored-by: aeneasr <aeneas@ory.sh>
Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com>
2020-10-20 14:55:49 +02:00
Ajanthan 077c54ab51
feat: API for deleting a client's access tokens (#2058)
Closes #1728
2020-09-20 09:43:58 +03:00
hackerman 5097805473
fix: bump pop to v5.2 (#1922)
Closes #1892
2020-06-22 16:22:40 +02:00
Furkan e785bc71cd
oauth2: add www-authenticate at userinfo endpoint (#1891)
Closes  #1827
2020-06-05 08:33:10 +02:00
hackerman 94057d9400
refactor: move migrations to gobuffalo/fizz (#1775)
This patch deprecates the previous migration system (sql-migrate) in favor of gobuffalo/fizz. No functional changes have been made.

BREAKING CHANGES: Please run `hydra migrate sql` before applying this release.
2020-04-30 10:58:57 +02:00
aeneasr c499e52bbc
Implement new SDK pipeline (interim)
This is an interim commit that got pushed to master by the CI on accident.
2020-01-07 16:12:18 +01:00
hackerman 9243dc2490
vendor: Fix SQL-regression caused by go 1.12.7 (#1534) 2019-08-19 19:11:44 +02:00
André Filipe b40519074f oauth2: Corrected oidc discovery claims and scope values (#1428)
Signed-off-by: André Filipe <andre.r.flip@gmail.com>
Signed-off-by: André Filipe Easypay <andre@easypay.pt>
2019-05-09 14:21:34 +02:00
hackerman bbeee653de
Implement OpenID Connect Front-/Backchannel logout (#1376)
Closes #1368 
Closes #1004 
Closes #834

Signed-off-by: aeneasr <aeneas@ory.sh>
2019-04-25 23:17:57 +02:00
hackerman 957a2d670a
oauth2: Expose revocation endpoint at OIDC Discovery (#1355)
Closes #12678

Signed-off-by: aeneasr <aeneas@ory.sh>
2019-04-11 20:42:49 +02:00
hackerman 6829a58622
sdk: Move to go-swagger code generator (#1347)
Signed-off-by: aeneasr <aeneas@ory.sh>
2019-04-09 13:24:13 +02:00