Commit Graph

224 Commits

Author SHA1 Message Date
Patrik a52a01e3b9 chore: fully implement provider pattern
GitOrigin-RevId: 0b1371bde6864620d6b4946c0c49dcfa4d7ac2ca
2025-11-26 09:47:26 +00:00
Henning Perl 2c3ba1311e Merge branch 'fosite-monorepo'
GitOrigin-RevId: 0496a85128a8006a1bdf0fb9ef3c393b31f90145
2025-10-31 12:37:14 +00:00
Patrik 172b36b5e1 chore: split up consent manager
GitOrigin-RevId: 65044b474e05128d8b9d70e0ecccc19ea8e7aaf6
2025-10-20 19:13:19 +00:00
Patrik bbac4a4be5 chore: remove redundant internal state
GitOrigin-RevId: ffdacf60d0eea3adeeb1fb78db114e3ca12f23e1
2025-09-30 12:23:20 +00:00
Patrik 8aee364805 fix(hydra): instrument metrics also on public endpoints
GitOrigin-RevId: 84ae1df26bd3d9a025655e50792ea7312f250cca
2025-08-26 13:54:45 +00:00
Patrik 8391d1bc57 test(hydra): convert custom JWT claim tests to table
GitOrigin-RevId: c0114d299bdec370104e8ad0b3042d3a3c045bb1
2025-08-22 09:26:12 +00:00
Patrik 6ba796b584 chore(hydra): remove unnecessary registry functionality
GitOrigin-RevId: 3ae84434cd150929d89cc4d4850a8087d5defcbc
2025-08-20 12:17:30 +00:00
Philippe Gaultier a147e3b640 feat(changelog): migrate http router to stdlib router
GitOrigin-RevId: ebd7ec330a4f7b9826cb70ba36ba2f727ea64c96
2025-08-19 12:32:40 +00:00
hackerman 63e617630a chore: use un-deprecated WithStack and cmp.Or
GitOrigin-RevId: a9efe036671b711ff9b7b88290ca2c3b93e5dfa3
2025-08-19 09:53:34 +00:00
hackerman cb0f1de3e1 chore: reduce use of external-facing AcceptOAuth2ConsentRequest
GitOrigin-RevId: 901a58e509019efd9d868cda10f2ede2d4ce1cf1
2025-08-08 14:20:39 +00:00
Patrik 29ba474a84 chore(hydra): improve test config setup
GitOrigin-RevId: 554890b424d335e9f87234212079894014372e66
2025-07-24 16:37:39 +00:00
Patrik 2d28980ded chore: shared serve config
GitOrigin-RevId: 011a5ffc6a6731b28222eeaa72d6bae92b9c0a81
2025-07-18 15:18:55 +00:00
Patrik cbf14c0b9c fix(changelog-oel): use keyset pagination instead of offset
GitOrigin-RevId: 61645585277edd95914705499afd7211a85983eb
2025-06-27 12:45:44 +00:00
hackerman d9ea5496d8 feat(changelog-oel): add expiry and TTL to `authentication_session` table
GitOrigin-RevId: 1a115d9e2055bbf9a0bb4ecf7c6a266b2b70a8cd
2025-06-24 10:59:40 +00:00
hackerman 96aec6f351 chore: use dedicated ory fork of pop
GitOrigin-RevId: dab6bce5af05a882f8fc81d61c9879f350bf8c05
2025-06-20 11:11:49 +00: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
Jonas Hungershausen 6da0fd327e
feat: improve oauth2 event data (#3975) 2025-04-14 10:17:22 +02:00
Arne Luenser 241dd45fa1
feat: add error reason to OAuth2TokenExchangeError event (#3971) 2025-04-10 10:47:49 +00:00
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 5d8635c943
fix: revoke by consent request ID (#3947)
This is a follow-up to #3932.

This makes several improvements, chiefly restoring backwards
compatibility to Hydra before #3932. We now return both the `challenge`
as well as the `consent_request_id` from our APIs and distinguish
between them clearly.

Closes #3941
2025-02-20 19:41:41 +01: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
Henning Perl 41476ec062
feat: support more claims in password grant (#3864)
For the resource owner password grant, the Kratos identity ID is now written to the sub claim, and the username is written to the ext.username claim. Further, token hooks are called for the initial token issuance as well as refresh flows for access tokens issued via the resource owner password grant, allowing users to customize the fields present in the access token (for the jwt strategy) as well as on introspection.

---------

Co-authored-by: Arne Luenser <arne.luenser@ory.sh>
2024-10-31 09:40:39 +01:00
Arne Luenser 9cc5f28825
fix: advertise support for response_mode=form_post in OIDC discovery document (#3861) 2024-10-23 08:37:32 +02:00
Arne Luenser fa50e3e999 fix: incorrect context passthru 2024-08-14 11:20:19 +02:00
Jonas Hungershausen d0e047ccc8
fix(docs): adjust note about SDK support on oauth2 flow endpoints (#3812) 2024-08-06 14:56:48 +02:00
hackerman 1bbfdb56e5
fix: do not retry sending responses (#3764) 2024-05-08 11:41:50 +02:00
hackerman 5b106aadb0
fix: wrap authorize response in transaction (#3763) 2024-05-07 17:04:59 +02:00
Henning Perl 67a85cc799
fix: wrap token handler in transaction (#3730) 2024-03-05 14:58:43 +01:00
hackerman d1f9ba8ede
fix: correct id token type in token exchange response (#3625)
Closes https://github.com/ory/client-go/issues/2
2023-09-05 15:15:21 +02:00
Henning Perl 0176adc178
fix: verifiable credentials JWT format (#3614) 2023-08-23 17:19:32 +02:00
Henning Perl 9f1c8d1920
fix: add kid to verifiable credential header (#3606) 2023-08-16 14:12:43 +02:00
dastein1 c72a31641e
feat: allow to disable claim mirroring (#3563)
This PR introduces another config option called `oauth2:mirror_top_level_claims` which may be used to disable the mirroring of custom claims into the `ext` claim of the jwt.
This new config option is an opt-in. If unused the behavior remains as-is to ensure backwards compatibility.

Example:

```yaml
oauth2:
  allowed_top_level_claims:
    - test_claim
  mirror_top_level_claims: false # -> this will prevent test_claim to be mirrored within ext
```

Closes https://github.com/ory/hydra/issues/3348
2023-08-11 12:04:07 +02:00
Henning Perl 219a7c068f
feat: add support for OIDC VC (#3575)
This adds initial support for issuing verifiable credentials
as specified in https://openid.net/specs/openid-connect-userinfo-vc-1_0.html.

Because the spec is still in draft, public identifiers are
suffixed with `draft_00`.
2023-08-04 10:57:36 +02:00
Henning Perl 44ed0ac895
feat: add event tracing (#3546) 2023-06-19 13:22:54 +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
hackerman cf20054f53
chore: remove unneeded dependency (#3494) 2023-04-18 12:59:49 +02:00
Henning Perl a6beed4659
feat: allow setting access token type in client (#3446)
The access token type (`jwt` or `opaque`) can now be set in the client configuration. The value set here will overwrite the global value for all flows concerning that client.
2023-03-02 16:17:09 +01:00
hackerman 9a5afd2135
chore: update alpine (#3449) 2023-02-28 08:17:06 +01: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
Loïc Mangeonjean 50666b96ef
fix: prevent multiple redirections to post logout url (#3366)
Closes #3342
2022-12-05 11:49:02 +01:00
Jonas Hungershausen 93bac074b3
fix: add `client_id` and `client_secret` to `revokeOAuth2Token` (#3373) 2022-12-01 09:15:40 +01:00
Kevin Goslar d768cf6580
docs: standardize license headers (#3216) 2022-11-03 10:10:12 -05:00
Savvas Mantzouranidis f59f1c6834
fix: scope type should be string instead of int (#3337)
Closes https://github.com/ory/sdk/pull/223
2022-11-03 15:48:38 +02: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
aeneasr 6b601564c1 refactor(sdk): rename errors
BREAKING CHANGE: Error models in the generated SDK have been renamed:

```patch
- oAuth2ApiError
+ errorOAuth2
```
2022-10-11 17:01:24 +02:00
Kevin Goslar 15cdb885b5
chore: format using Make (#3257) 2022-09-22 15:56:09 -04:00
aeneasr a364db4ff2 fix: move to v0alpha2 api spec 2022-09-07 08:10:31 +02:00
aeneasr 7893a98038 fix(oauth2): incorrect TTL override 2022-09-07 08:10:31 +02:00
aeneasr 937e6baabf fix: resolve internal SDK regressions 2022-09-07 08:10:31 +02:00