Commit Graph

196 Commits

Author SHA1 Message Date
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
aeneasr c12b45cc44 refactor(oauth2): clean up changes 2022-09-07 08:10:31 +02:00
aeneasr ea4caf7341 refactor(oauth2): rename SDK method from `deleteOAuth2Token` to `adminDeleteOAuth2Token`
BREAKING CHANGE: Rename SDK method from `deleteOAuth2Token` to `adminDeleteOAuth2Token`.
2022-09-07 08:10:31 +02:00
aeneasr 51b58e7ead refactor(oauth2): rename SDK method from `oauth2Token` to `performOAuth2TokenFlow`
BREAKING CHANGE: Rename SDK method from `oauth2Token` to `performOAuth2TokenFlow`.
2022-09-07 08:10:31 +02:00
aeneasr f2bd9a30a9 refactor(oauth2): rename SDK method from `introspectOAuth2Token` to `adminIntrospectOAuth2Token`
BREAKING CHANGE: Rename SDK method from `introspectOAuth2Token` to `adminIntrospectOAuth2Token`.
2022-09-07 08:10:31 +02:00
aeneasr 4e554e7a93 refactor(oauth2): rename SDK method from `userinfo` to `getOidcUserInfo`
BREAKING CHANGE: Rename SDK method from `userinfo` to `getOidcUserInfo`.
2022-09-07 08:10:31 +02:00
aeneasr df467a0605 refactor(oauth2): rename SDK method from `discoverOpenIDConfiguration` to `discoverOidcConfiguration`
BREAKING CHANGE: Rename SDK method from `discoverOpenIDConfiguration` to `discoverOidcConfiguration`.
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 e466d7c9d2 refactor: `hydra keys` command
BREAKING CHANGE: The `hydra keys create|delete|get|import` commands have changed to follow other Ory project's guidelines, including structured output and improved handling. They are now:

```
hydra create jwks
hydra get jwks
hydra delete jwks
hydra import jwk
```

Please head over to the documentation for more information or use the `--help` CLI flag for each command.
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 d746fa499a fix: support issuer with and without trailing slash
BREAKING CHANGE: The `iss` (issuer) value no longer appends a trailing slash but instead uses the raw value set in the config.

Setting

```yaml
urls:
  self:
    issuer: https://auth.example.com
```

has changed

```patch
-  "iss": "https://auth.example.com/"
+  "iss": "https://auth.example.com"
```

To set a trailing slash make sure to set it in the config value:

```yaml
urls:
  self:
    issuer: https://auth.example.com/
```

Closes #1482
2022-09-07 08:10:31 +02:00
hackerman 1ab345b9ee fix(sdk): handle all error codes (#3153)
Closes #2350
2022-09-07 08:10:31 +02:00
hackerman c51b21bb23 fix: missing data in JWT grant (#3143)
Co-authored-by: Andreas Krause <a.krause@celonis.com>
2022-09-07 08:10:31 +02:00
aeneasr 0a786b7cd3 fix(jwk): expose correct metadata algorithms 2022-09-07 08:10:31 +02:00
aeneasr 148cadb200 refactor: remove `oauth2.include_legacy_error_fields` config
BREAKING CHANGE: OAuth2 errors can no longer be returned in the legacy error format. Essentially, fields `error_hint`, `error_debug` have been removed. Option `oauth2.include_legacy_error_fields` has been removed.
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 53862f290c refactor: improve performance and reduce data use of consent persistence layer (#2836)
This patch changes the internal data structure and reduces four (sort of redundant) tables into one. As part of this change, a few new tools have been added:

* Introduce the `hydra sql gen` command and a convenience Make target with autocompletion. The command reads migration templates from a source directory and produces migration files in a target directory. Its main function is to split a single source file into multiple files using split marks.

* Introduce the `hack/db-diff.sh` command to generate database schema diffs at different commits. This script is used to view and review the impact of migrations on the database schema.

BREAKING CHANGES: This patch merges four SQL Tables into a new table, deleting the old tables in the process. The migrations in this patch are expected to be applied offline. Please be aware that *there are no down migrations*, and if something goes wrong, data loss is possible. Always back up your database before applying migrations. For more information, see [Hydra 2.x Migration Guide](https://www.ory.sh/hydra/docs/guides/migrate-v2).

Rows with NULL login_challenge in `hydra_oauth2_consent_request` and corresponding `hydra_oauth2_consent_request_handled` are deleted as a side effect of the merge migration. This is done with the assumption that only a very small number of sessions, issued by pre-1.0 Hydra, will be affected. Please contact us if this assumption doesn't apply or if the deletion adversely affects your deployment.

Signed-off-by: Grant Zvolsky <grant@zvolsky.org>
2022-09-07 08:10:31 +02:00
Mart Aarma 22e1ebb574
feat: async backchannel logout (#2849)
Co-authored-by: aeneasr <3372410+aeneasr@users.noreply.github.com>
2022-04-28 23:42:37 +02:00
Andrew Minkin 5895d03a37
docs: ORY -> Ory to follow styleguides (#2941) 2022-01-18 14:44:04 +01:00
Felix Jung f701310a8b
feat: include amr claim in ID token (#2770)
Closes #1756

Co-authored-by: Stepan Rakitin <stepanr@mailbox.org>
2021-09-30 14:25:06 +02:00
Stepan Rakitin 1a7dcd1c46
feat: refresh token hook to update claims (#2649)
This patch adds a new feature to Ory Hydra which allows the updating of access and ID tokens during the refresh flow. To set it up, use the `oauth2.refresh_token_hook` configuration to set up a HTTP(S) endpoint which receives a POST request when a refresh token is about to be issued.

Closes #2570

Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com>
2021-09-01 09:28:04 +03:00
Flavio Leggio 6ea0bf8f4d
feat: improve delete queries for janitor command (#2540)
This patch improves delete queries by separating the data extraction from actual delete. Extraction is made with a configurable limit, using the `--limit` CLI flag. Deletes use that list in batch mode with a configurable batch size (`--batch-size` CLI flag). Default value for limit is 100000 records and default value for batch size is 100 records.

To improve performance, `LEFT JOIN` is used to select also login and consent requests which did not result in a complete authentication, i.e. user requested login but timed out or user logged in and timed out at consent. Also, two independent `SELECT`s are used in the extraction of login and consent requests eligible for deletion. This solves a bug in the single `SELECT` causing deletion of consent requests where matching login requests were eligible for deletion and vice versa. With independent `SELECT`s we keep consent requests even if matching login request gets deleted.

Closes #2513
2021-08-04 17:46:14 +02:00
aeneasr 1807e893fd
fix: resolve sdk build issues 2021-07-06 15:22:07 +02:00
Flori 63402dee76
feat: add custom claims to top-level JWT payload (#2545)
Closes #1974

Co-authored-by: hackerman <3372410+aeneasr@users.noreply.github.com>
2021-06-11 12:29:08 +02: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