DATE:
AUTHOR:
Ory Team
Ory Network Ory Hydra Ory Kratos Ory Polis Ory Elements Ory Enterprise License

Ory Network, Ory Hydra, Ory Kratos, Ory Polis, Ory Elements v26.4.18 released

DATE:
AUTHOR: Ory Team

Ory Network

Remind users how they signed in last time

Ory Account Experience can now show a Last used badge on the social sign-in or SSO button that a user chose the last time they signed in on the same device. The choice is stored only in the user's browser. To turn it on, go to Branding > Theming in Ory Console and turn on Remind users how they signed in last time in the General card, or set account_experience_show_last_used_method in the normalized project API. The setting is off by default and available on every plan. See Last used sign-in method.


This is now available on Ory Network.


Ory Hydra

Deleting a consent flow no longer deletes its tokens and codes

The foreign keys from the six token and code tables to hydra_oauth2_flow are dropped by six migrations. Consent revocation deletes tokens and codes itself, so its behavior is unchanged. Deleting flow rows directly in the database no longer deletes the tokens and codes issued under them; they expire on their own.

Upgrade to v26.4.16 before this release and do not skip it. Finish rolling it out on every Hydra instance before you apply this release's migrations. A process older than v26.4.16 that revokes consent against this release's schema leaves the flow's unredeemed authorization codes and device codes valid until they expire.

On PostgreSQL, apply the migrations in a quiet window. Each of the six migrations takes an ACCESS EXCLUSIVE lock on the table it alters and on hydra_oauth2_flow. A long-running transaction delays that lock, and queries against both tables queue behind it until the migration finishes.

Rolling back re-adds the foreign keys, which fails while any token or code references a consent flow that no longer exists. Before rolling back, clear those references with the statement in the revert guide, and run the down migrations before starting an older version.


This is now available for the Ory Enterprise License and will be part of the next Ory Open Source release.


Ory Kratos

Before webhooks return their messages when they interrupt a flow

A before webhook that interrupts a login, registration, recovery, verification, or settings flow with validation messages now returns those messages. The request fails with a 400 Bad Request error with the ID webhook_flow_interrupted. The error's reason is the text of the first message, and details.messages lists every message the webhook returned.

Previously, the messages were dropped and the request failed with an unrelated 404 Not Found or 500 Internal Server Error.

API flows and browser flows that request JSON receive the error in the response body. Other browser flows redirect to the error UI. This now includes the recovery and verification flows, which used to answer browsers with JSON.

Ory Kratos Identities doesn't create a flow when a before webhook interrupts it. If your client checked for the earlier 404 or 500 response to detect an interrupted flow, check for the webhook_flow_interrupted error ID instead.

Identity search no longer matches values an identity has lost

After you changed or removed an identity's traits, public metadata, or admin metadata, identity search kept matching the old values. A search for a removed value still returned the identity, and a filter_by that excludes that value, such as metadata_admin.createdBy:!=backoffice, left the identity out. This affected search in the Ory Console and the identity search API. Search now matches only the values an identity currently has, including for identities updated before this release. You don't need to update identities again.


This is now available on Ory Network, for the Ory Enterprise License, and will be part of the next Ory Open Source release.


Ory Polis

External database drivers instrument themselves

Ory Polis no longer registers OpenTelemetry instrumentation for DynamoDB, MongoDB or Redis, and @opentelemetry/instrumentation-aws-sdk, @opentelemetry/instrumentation-mongodb and @opentelemetry/instrumentation-redis are no longer dependencies of @boxyhq/saml-jackson. Database spans for these databases stop with this release; a driver package that wants them registers its own instrumentation, as described in the External databases documentation. Spans for the built-in SQL databases are unchanged.

A page read by pageToken no longer gets slower the deeper it is

On the SQL databases, a list call that continues from a pageToken now starts reading at that position. Before, the database still read and discarded every record ahead of it, as it does for pageOffset, so walking a large namespace or directory page by page took longer with every page. With one million records, a page 100,000 records deep went from 19 ms to 1 ms on PostgreSQL and from seconds to 2 ms on MariaDB; MySQL already read such a page in 2 ms. Pages requested by pageOffset are unchanged, so prefer pageToken for deep or complete walks.

PostgreSQL, CockroachDB and YugabyteDB get a new index for this, _jackson_store_namespace_created_key on jackson_store ("namespace", "createdAt", "key"), which replaces _jackson_store_namespace_created. Deployments that run migrations themselves (DB_MANUAL_MIGRATION=true) need to run the two new migrations; on PostgreSQL and YugabyteDB the index is built concurrently, and the old one is dropped only once the new one is valid. Deployments that let Polis update the schema at startup get the index built without CONCURRENTLY on PostgreSQL and YugabyteDB, which holds up writes to jackson_store while it is built. For a large table, set DB_MANUAL_MIGRATION=true and run the migrations before starting the new version.

The MongoDB driver package gets the same treatment. Its lists were sorted without an index in their order, so every page read and sorted the whole namespace or index match. It now creates two indexes at startup, namespace_created on { namespace, createdAt, _id } and indexes_created on { indexes, createdAt, _id }, and a page reads only its own documents. The first start on a collection that has documents waits for the indexes to be built. The namespace_1 and indexes_1 indexes of earlier versions are no longer used and can be dropped once every instance is upgraded.

List endpoints page by token on every database

Every paginated list endpoint now returns a pageToken when a page follows, whatever the database. Until now only DynamoDB did; on every other database a client walked a list with pageOffset, which makes the database skip over every record before the offset on each request and gets slower the deeper the walk goes. Passing the pageToken back reads the next page from where the previous one ended, at the same cost on every page, and is not disturbed by records deleted in the meantime.

pageOffset keeps working as before. A pageToken is only meaningful to the Ory Polis version and database that issued it; one kept across an upgrade is rejected with a 400 and the walk is started again without it. The SCIM endpoints, which page by startIndex as the SCIM standard requires, are unchanged.

The Admin Portal pages its lists by token

Every list in the Admin Portal (connections, directories, users, groups, group members, webhook events, setup links, SSO traces and Identity Federation apps) now asks for a page with the pageToken the page before it returned, and no longer by offset, so a page deep in a long list loads as fast as the first. The address of a page carries its token, which makes a reload, a shared link and the browser's back button read the same page the same way. Next is offered only when the server has another page. Previous returns through the pages you came from; on a page opened directly from a link, it goes to the first page.

GET /api/v1/dsync/product and the Admin Portal's own directory list now return a pageToken on every database. They returned one on DynamoDB only, so the list of directories could not be continued by token on the others. pageOffset works on the endpoint as before, and so does directories.getAll and directories.filterBy in the npm library.


This is now available for the Ory Enterprise License and will be part of the next Ory Open Source release.


Ory Elements

One-time code screens confirm that a code was resent

On screens where users enter a one-time code, the Resend code link now shows that a new code was sent. While the request is in progress, the link is dimmed. After Ory sends the new code, the link reads "Code sent" with a check mark for five seconds, and screen readers announce it. Then it reads Resend code again. Clicks on the link do nothing while it is dimmed or reads "Code sent".

Verification screens that Ory opens for a phone number, such as after sign-up or after a user changes their phone number, now have a working Resend code link. Before, users on these screens could not request a new code.

Custom components can read the same state from useResendCode(). Its new resendCodeStatus value is "sending" while a resend is in progress, "sent" once Ory has confirmed it, and "idle" otherwise. Code that uses resendCode and resendCodeNode keeps working without changes.

Show a "Last used" badge on social sign-in and SSO buttons in Ory Elements

Set show_last_used_method: true in config.project to mark the social sign-in or SSO button that a user chose the last time they signed in on the same device. The badge is off by default and shows only on login screens. Ory Elements keeps the choice in the browser's localStorage and never stores the identifier itself. To store the choice elsewhere, pass the same lastUsedMethodStorage to both Login and Registration, or to every OryProvider that renders a login or registration flow. A flow without it uses localStorage. Custom components can read the choice with useLastUsedMethod() or the new isLastUsed prop of Node.SsoButton. See Last used sign-in method.


This is now available on Ory Network, for the Ory Enterprise License, and will be part of the next Ory Open Source release.


Ory Keto, Ory Oathkeeper, and Ory Terraform

No significant changes in this release.

Powered by LaunchNotes