Commit Graph

50 Commits

Author SHA1 Message Date
Nikos Sklikas 5215d2482a
feat: implement RFC 8628 (#3912)
This patch introduces the OAuth 2.0 Device Authorization Grant to Ory
Hydra. The OAuth 2.0 device authorization grant is designed for
Internet-connected devices that either lack a browser to perform a
user-agent-based authorization or are input constrained to the extent
that requiring the user to input text in order to authenticate during
the authorization flow is impractical. It enables OAuth clients on such
devices (like smart TVs, media consoles, digital picture frames, and
printers) to obtain user authorization to access protected resources by
using a user agent on a separate device.

The OAuth 2.0 Device Authorization Grant may also become relevant for AI
Agent authentication flows and is generally an amazing step and
innovation for this project.

A very special thanks goes to @nsklikas from
[Canonical](https://canonical.com), @supercairos from
[shadow.tech](https://shadow.tech) and @BuzzBumbleBee.

For more details, please check out the documentation
(https://github.com/ory/docs/pull/2026)

To implement this feature, you will need to implement two additional
screens in your login and consent application. A reference
implementation can be found
[here](99ca6ad544/src/routes/device.ts).

Closes #3851
Closes #3252
Closes #3230
Closes #2416
2025-02-26 13:41:41 +01:00
Arne Luenser fa21711949 fix: pass context to database ping 2024-11-27 12:27:52 +01:00
Arne Luenser cd7e7eff91
feat: upgrade to jackc/pgx/v5 (#3798) 2024-08-29 13:53:03 +00:00
hackerman 7311a794c7
chore: reduce registry code bloat and improve DI (#3794) 2024-07-16 11:32:45 +02:00
Arne Luenser 8eed306800
feat: allow Go migrations (#3602) 2023-08-10 14:29:05 +02:00
Arne Luenser 8900cbb770
feat: allow additional SQL migrations (#3587) 2023-08-03 12:28:58 +02:00
Arne Luenser 6e1f5454be
fix: reduce SQL tracing noise (#3481) 2023-04-06 09:36:36 +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
Kevin Goslar d768cf6580
docs: standardize license headers (#3216) 2022-11-03 10:10:12 -05:00
Mikhail Kopylov 5842946d15
feat: add `db.ignore_unknown_table_columns` configuration property (#3192) (#3193)
The property allows to ignore scan errors when columns in the SQL result have no fields in the destination struct.
2022-10-04 11:31:19 +02:00
Anirudh Oppiliappan 2ee922938b feat(tracing): add lots of tracing spans (#3125) 2022-09-07 08:10:31 +02:00
aeneasr d1af32dc9e fix: use config func everywhere 2022-09-07 08:10:31 +02:00
aeneasr 6eee09cc72 fix: resolve merge conflicts 2022-09-07 08:10:31 +02:00
aeneasr 68cb7d511f fix: compile issues 2022-09-07 08:10:31 +02:00
aeneasr bbe0406df6 feat: config hot reloading architecture 2022-09-07 08:10:31 +02:00
Bernat Mut González a5cc6eaea9 fix: fix unbatched select in flushInactiveTokens
chore: code review

chore: format

don't delete more tokens than expected.

correct test.

add nid in flush tokens.
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
Ludovic Cleroux a383b5a655
fix: ping logic for SQL Registry (#3095)
Closes #2734
2022-05-18 08:46:00 +02:00
Mart Aarma 90523fd0d3
feat: add hsm key set prefix to support multiple hydra instances on the same hsm partition (#3066)
This pull request adds configuration option `hsm.key_set_prefix` to support multiple Ory Hydra instances to store keys on the same HSM partition. For example if `hsm.key_set_prefix=app1.` then key set `hydra.openid.id-token` would be generated/requested/deleted on HSM with `CKA_LABEL=app1.hydra.openid.id-token`

This will not affect Hydra API in any way. `GET /keys/hydra.openid.id-token` will return key set from HSM with label `app1.hydra.openid.id-token`.
2022-04-24 23:05:12 +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
aeneasr 42fec62c07 fix: missing imports 2022-01-06 12:36:15 +01:00
aeneasr b284353de6 fix: use pop/v6 2022-01-06 12:36:15 +01:00
Vladimir Kalugin 858f2cf362
feat: support for urn:ietf:params:oauth:grant-type:jwt-bearer grant type RFC 7523 (#2384)
This change adds support for JSON Web Token (JWT) Profile for OAuth 2.0 Authorization Grants (RFC7523).
Users of Ory Hydra will be able to grant permission for OAuth 2.0 Client to act on behalf of some Resource Owner using JWT Bearer Assertions.

For more information about this feature, please head over to the documentation: https://www.ory.sh/hydra/docs/next/guides/oauth2-grant-type-jwt-bearer

Closes #2229

BREAKING CHANGES: Please notice that this change requires SQL migrations to be applied! As always, please make a backup before applying them!

Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
Co-authored-by: Jagoba Gascón <jagoba@arima.eu>
Co-authored-by: Gajewski Dmitriy <dmit8815@gmail.com>
2021-12-26 20:15:53 +02:00
Dimitrij Drus 0a9df1579b
feat: making use of the updated instrumentedsql version (#2713) 2021-09-03 17:06:00 +03:00
Arthur Knoepflin 81e0784b76
feat: add max_conn_idle_time flag (#2551) 2021-06-02 15:00:15 +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
aeneasr 883a84f887 fix: better http resiliency and sqlite updates 2021-03-08 17:24:00 +01:00
aeneasr 6fa591c849 feat: move to go 1.16 and static embed files 2021-03-08 17:24:00 +01:00
aeneasr 8fc3e2e3ce refactor: deprecate driver semantics 2020-12-02 13:37:05 +01:00
aeneasr fdf142cc7c feat: improve error stack trace wrapping 2020-11-17 17:25:54 +01:00
aeneasr 6b2ad6b77f style: format and cleanup 2020-10-20 14:55:49 +02:00
aeneasr b3dda7c8c9 fix: add support for tracing to SQL 2020-10-20 14:55:49 +02: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
aeneasr 534203c541
fix: use SameSite=Lax for dev environments per default 2020-08-14 10:02:59 +02:00
aeneasr d6cfecdfb1 chore: bump deps 2020-05-28 14:35:37 +02:00
Patrik 849fe62e91
fix: automatically append multiStatements parameter to mySQL URI (#1835)
Co-authored-by: aeneasr <aeneas@ory.sh>
2020-04-30 19:41:08 +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
巢鹏 caec46117a
feat: add session data encryption (#1750)
Closes #1649

Currently, Hydra stores claims from consent application as a raw JSON string in the database. If a threat agent gains access to the database, he/she will be able to get access to those strings. This patch introduces a new feature which encrypts the raw JSON string in the same way we encrypt JSON Web Keys using AES-GCM.

This patch is backwards compatible and will encrypt old sessions over time when they are used or updated. This does not affect sessions that have already expired and we recommend purging those sessions from the database if you want sessions to be encrypted.

To disable this feature, set `oauth2.session.encrypt_at_rest` to `false`.
2020-03-13 14:35:50 +01:00
aeneasr f1c926bd72 fix: Resolve linter complaints 2020-02-03 14:58:00 +01: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 3578b0438c
Remove stray fmt.Printf (#1547) 2019-08-29 12:01:55 +02:00
hackerman 9243dc2490
vendor: Fix SQL-regression caused by go 1.12.7 (#1534) 2019-08-19 19:11:44 +02:00
hackerman e4ae446ff6
driver: Fix migration plan output (#1504)
The output of "migration sql" returned duplicate lines and misassigned migrations to their components.

This patch resolves that.
2019-08-05 18:35:26 +02:00
David f8f23630d8 all: add CockroachDB support (#1348)
Closes #1326 

Signed-off-by: David López <not4rent@gmail.com>
2019-05-10 13:18:19 +02:00
aeneasr a4a27179d9 cmd: Add migration planning
Closes #1139

Signed-off-by: aeneasr <aeneas@ory.sh>
2019-04-27 10:45:49 +02:00
hackerman 22c0487c7b
Resolve sql testing race issues (#1332)
Signed-off-by: aeneasr <aeneas@ory.sh>
2019-04-02 13:50:44 +02:00
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