Commit Graph

314 Commits

Author SHA1 Message Date
Patrik a52a01e3b9 chore: fully implement provider pattern
GitOrigin-RevId: 0b1371bde6864620d6b4946c0c49dcfa4d7ac2ca
2025-11-26 09:47:26 +00:00
shaunn db17987979 chore: fosite and hydra interface enhancements
GitOrigin-RevId: f149949f3fdd7b1264ce78c011d49dee61af52a2
2025-11-14 17:25:52 +00:00
shaunn c3091857a6 chore: refactored fosite interfaces
GitOrigin-RevId: 8f7c9e215c83f16bc5b2e8b593a56efcfcfd2de7
2025-11-05 00:34:18 +00:00
Henning Perl 2c3ba1311e Merge branch 'fosite-monorepo'
GitOrigin-RevId: 0496a85128a8006a1bdf0fb9ef3c393b31f90145
2025-10-31 12:37:14 +00:00
Patrik f8a53b0193 feat: list clients by ID
GitOrigin-RevId: 7fbfc60678beca387f854a96b55e908632508388
2025-10-29 13:51:53 +00:00
Patrik 42b6a79041 test: split up consent manager test
GitOrigin-RevId: 80483effb7e51d3eebf14339600174252fc56b38
2025-10-23 14:20:47 +00:00
Patrik 6884b97b43 chore: improve migration testdata and assertions
GitOrigin-RevId: 4790c0d668fbcbe4005791b9b969df973197ddd2
2025-10-09 10:57:48 +00:00
hackerman 4999d20db2 chore: fix all hydra linter issues
GitOrigin-RevId: 75db758dab3afb34587dcfaf40935ee4ea69c7b6
2025-09-29 09:07:24 +00:00
Patrik 8aee364805 fix(hydra): instrument metrics also on public endpoints
GitOrigin-RevId: 84ae1df26bd3d9a025655e50792ea7312f250cca
2025-08-26 13:54:45 +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
Patrik dd97ec88ea chore(hydra): registry setup refactoring
GitOrigin-RevId: 8504255cc935c7057faf174814db75532a95c0d5
2025-08-18 09:29:26 +00:00
Patrik 29ba474a84 chore(hydra): improve test config setup
GitOrigin-RevId: 554890b424d335e9f87234212079894014372e66
2025-07-24 16:37:39 +00:00
Arne Luenser c6fa2a6f17 fix: jsonx.ApplyJSONPatch
GitOrigin-RevId: 43c10801f5051e3d5fbea5f4f5e90394f6da0fbb
2025-07-23 17:04:00 +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
hackerman 4053c9ecc1
feat: improve openapi spec (#3908)
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request.

This text will be included in the changelog. If applicable, include
links to documentation or pieces of code.
If your change includes breaking changes please add a code block
documenting the breaking change:

```
BREAKING CHANGES: This patch changes the behavior of configuration item `foo` to do bar. To keep the existing
behavior please do baz.
```
-->

## Related issue(s)

<!--
If this pull request

1. is a fix for a known bug, link the issue where the bug was reported
in the format of `#1234`;
2. is a fix for a previously unknown bug, explain the bug and how to
reproduce it in this pull request;
3. implements a new feature, link the issue containing the design
document in the format of `#1234`;
4. improves the documentation, no issue reference is required.

Pull requests introducing new features, which do not have a design
document linked are more likely to be rejected and take on average 2-8
weeks longer to
get merged.

You can discuss changes with maintainers either in the Github
Discussions in this repository or
join the [Ory Chat](https://www.ory.sh/chat).
-->

## Checklist

<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR.

Please be aware that pull requests must have all boxes ticked in order
to be merged.

If you're unsure about any of them, don't hesitate to ask. We're here to
help!
-->

- [ ] I have read the [contributing
guidelines](../blob/master/CONTRIBUTING.md).
- [ ] I have referenced an issue containing the design document if my
change
      introduces a new feature.
- [ ] I am following the
[contributing code
guidelines](../blob/master/CONTRIBUTING.md#contributing-code).
- [ ] I have read the [security policy](../security/policy).
- [ ] I confirm that this pull request does not address a security
vulnerability. If this pull request addresses a security vulnerability,
I
      confirm that I got the approval (please contact
[security@ory.sh](mailto:security@ory.sh)) from the maintainers to push
      the changes.
- [ ] I have added tests that prove my fix is effective or that my
feature
      works.
- [ ] I have added or changed [the
documentation](https://github.com/ory/docs).

## Further Comments

<!--
If this is a relatively large or complex change, kick off the discussion
by explaining why you chose the solution
you did and what alternatives you considered, etc...
-->
2025-03-13 15:36:23 +01: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
Paul fb1655ba86
fix: allow updating when JWKS URI is set (#3935) (#3946)
The client validator no longer rejects PATCH and PUT updates when `JSONWebKeysURI` is non-empty and `JSONWebKeys` is not nil.

Closes #3935
2025-02-25 11:56:30 +01:00
Atsuki Narita 50eefbc21c
fix: Correct multiple instances of 'stragegy' typo (#3906)
This commit addresses several occurrences where 'strategy' was
misspelled as 'stragegy' throughout the codebase.

Additionally, a similar issue was found and corrected in the Ory
documentation repository (ory/docs), with a corresponding pull request
submitted.
2025-02-21 21:25:11 +01:00
Henning Perl 007e22412a
fix: tos_uri validation (#3945)
Contributes to https://github.com/ory-corp/cloud/issues/7395

---------

Co-authored-by: Arne Luenser <arne.luenser@ory.sh>
2025-02-20 20:28:47 +00:00
Atsuki Narita b746e41eda
fix: JWT documentation link to point to the correct resource (#3907)
The previous link in the documentation led to a page unrelated to JWT.
Updated the URL to https://www.ory.sh/docs/oauth2-oidc/jwt-access-token,
which provides proper JWT guidance.
2025-02-20 19:51:03 +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
Arne Luenser 25598191ee fix: limit HTTP response size 2024-11-27 12:35:55 +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
hackerman 7311a794c7
chore: reduce registry code bloat and improve DI (#3794) 2024-07-16 11:32:45 +02:00
hackerman 2a653e6680
feat: add skip_logout_consent option to clients (#3705)
Adds a special field which disables the logout consent screen when performing OIDC logout.
2024-01-30 16:19:34 +01:00
Arne Luenser 24c3be574a
fix: improved SSRF protection (#3669) 2023-11-22 17:32:03 +01:00
Henning Perl 88b0b7cfdf
feat: allow injecting extra fosite strategies (#3646) 2023-10-17 10:43:54 +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 1f1121caef
fix: add exceptions for internal IP addresses (#3608) 2023-08-16 14:17:49 +02:00
Arne Luenser 1d73d83eb0
fix: reject invalid JWKS in client configuration / dependency cleanup and bump (#3603) 2023-08-11 16:33:22 +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 efd9ca7d56
chore: bump deps (#3560) 2023-07-04 10:21:51 +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 2796d53798
fix: use correct default value (#3469)
Closes #3420
2023-03-16 16:12:06 +01: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
Henning Perl 4f65365f14
feat: allow skipping consent for trusted clients (#3451)
This adds a new boolean parameter `skip_consent` to the admin APIs of
the OAuth clients. This parameter will be forwarded to the consent app
as `client.skip_consent`.

It is up to the consent app to act on this parameter, but the canonical
implementation accepts the consent on the user's behalf, similar to
when `skip` is set.
2023-03-02 12:47:30 +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
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
hackerman aea37d6a35
fix: use correct sdk tag (#3318) 2022-10-26 14:04:20 +02:00
aeneasr e800002d09 refactor(sdk): consent SDK
BREAKING CHANGE: SDK naming has changed for the following operations:

```patch
ory.
-   V0alpha2Api.AdminRevokeOAuth2ConsentSessions(cmd.Context()).
+   OAuth2Api.RevokeOAuth2ConsentSessions(context.Background()).
    Client(clientId).Execute()

ory.
-   V0alpha2Api.AdminListOAuth2SubjectConsentSessions(cmd.Context(), id).
+   OAuth2Api.RevokeOAuth2ConsentSessions(context.Background()).
    Client(clientId).Execute()

ory.
-   V0alpha2Api.AdminListOAuth2SubjectConsentSessions(context.Background()).
+   OAuth2Api.ListOAuth2ConsentSessions(context.Background()).
    Subject(subjectId).Execute()

ory.
-   V0alpha2Api.AdminRevokeOAuth2LoginSessions(context.Background()).
+   OAuth2Api.RevokeOAuth2LoginSessions(context.Background()).
    Subject(subjectId).Execute()

ory.
-   V0alpha2Api.AdminGetOAuth2LoginRequest(context.Background()).
+   OAuth2Api.GetOAuth2LoginRequest(context.Background()).
    LoginChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminAcceptOAuth2LoginRequest(context.Background()).
+   OAuth2Api.AcceptOAuth2LoginRequest(context.Background()).
    AcceptOAuth2LoginRequest(body).
    LoginChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminRejectOAuth2LoginRequest(context.Background()).
+   OAuth2Api.RejectOAuth2LoginRequest(context.Background()).
    RejectOAuth2Request(body).
    LoginChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminGetOAuth2ConsentRequest(context.Background()).
+   OAuth2Api.GetOAuth2ConsentRequest(context.Background()).
    ConsentChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminAcceptOAuth2ConsentRequest(context.Background()).
+   OAuth2Api.AcceptOAuth2ConsentRequest(context.Background()).
    AcceptOAuth2ConsentRequest(body).
    ConsentChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminRejectOAuth2ConsentRequest(context.Background()).
+   OAuth2Api.RejectOAuth2ConsentRequest(context.Background()).
    RejectOAuth2Request().
    ConsentChallenge(challenge).Execute()

ory.
-   V0alpha2Api.AdminAcceptOAuth2LogoutRequest(context.Background()).
+   OAuth2Api.AcceptOAuth2LogoutRequest(context.Background()).
    LogoutChallenge(challenge).
    Execute()

ory.
-   V0alpha2Api.AdminRejectOAuth2LogoutRequest(context.Background()).
+   OAuth2Api.RejectOAuth2LogoutRequest(context.Background()).
    LogoutChallenge(challenge).
    Execute()

ory.
    V0alpha2Api.AdminGetOAuth2LogoutRequest(context.Background()).
+   OAuth2Api.GetOAuth2LogoutRequest(context.Background()).
    LogoutChallenge(challenge).
    Execute()

- var AlreadyHandledError HandledOAuth2LoginRequest
+ var AlreadyHandledError ErrorOAuth2LoginRequestAlreadyHandled

- var AlreadyHandledError HandledOAuth2LoginRequest
+ var AlreadyHandledError ErrorOAuth2ConsentRequestAlreadyHandled

- var OAuth2SuccessResponse SuccessfulOAuth2RequestResponse
+ var OAuth2SuccessResponse OAuth2RedirectTo
```
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
aeneasr cb742ad0d6 refactor(sdk): rename oauth2 client operations and payloads
BREAKING CHANGE: The SDK API for the following has changed:

```patch
// Go example
ory.
-   V0alpha2Api.AdminUpdateOAuth2Client(cmd.Context(), id)
+   Oauth2Api.SetOAuth2Client(cmd.Context(), id).
    OAuth2Client(client).Execute()

ory.
-   V0alpha2Api.AdminGetOAuth2Client(cmd.Context(), id).
+   Oauth2Api.GetOAuth2Client(cmd.Context(), id).
    Execute()

ory.
-   V0alpha2Api.AdminDeleteOAuth2Client(cmd.Context(), id).
+   Oauth2Api.DeleteOAuth2Client(cmd.Context(), id).
    Execute()

ory.
-   V0alpha2Api.AdminCreateOAuth2Client(cmd.Context()).
+   Oauth2Api.CreateOAuth2Client(cmd.Context()).
    OAuth2Client(client).Execute()

ory.
-   V0alpha2Api.DynamicClientRegistrationGetOAuth2Client(cmd.Context(), id).
+   OidcApi.GetOidcDynamicClient(cmd.Context(), id).
    Execute()

ory.
-   V0alpha2Api.DynamicClientRegistrationGetOAuth2Client(cmd.Context()).
+   OidcApi.CreateOidcDynamicClient(cmd.Context()).
    OAuth2Client(client).Execute()

ory.
-   V0alpha2Api.DynamicClientRegistrationDeleteOAuth2Client(cmd.Context()).
+   OidcApi.DeleteOidcDynamicClient(cmd.Context()).
    OAuth2Client(client).Execute()

ory.
-   V0alpha2Api.DynamicClientRegistrationUpdateOAuth2Client(cmd.Context(), id).
+   OidcApi.SetOidcDynamicClient(cmd.Context(), id).
    Execute()
```
2022-10-11 17:01:24 +02:00
Kevin Goslar 15cdb885b5
chore: format using Make (#3257) 2022-09-22 15:56:09 -04:00