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

Ory Network, Ory Kratos, Ory Polis v26.4.17 released

DATE:
AUTHOR: Ory Team

Ory Network

Redirect visitors who open your project domain without a path

Opening / on your project's slug domain or custom domain can now redirect visitors instead of returning a 404 error: either to the project's global redirect URL, or to a URL of your choice, such as the login page. Set it in the Index route card on the Account Experience theming page in the Console, or with index_route in the Account Experience configuration.

See how many backup recovery codes a user has left

Ory Kratos Identities now reports how many backup recovery codes a user has left, so your UI can remind users to generate new codes before they run out.

While an identity has backup recovery codes, the lookup_secret group of the settings flow contains a text node with the ID lookup_secret_remaining. Its message, 1050025, reads "You have 9 of 12 backup recovery codes left." and carries the counts in the remaining_codes and total_codes context fields.

After a login with a backup recovery code, the JSON response to a successful login includes a lookup_secret object with remaining_codes and total_codes. Native apps and browser apps that submit the login as JSON receive it. Logins that end in a redirect don't include it, and neither do logins that continue an OAuth2 login challenge. See Lookup Secrets.


This is now available on Ory Network.


Ory Kratos

GitHub sign-in exposes public profile fields in raw claims

The github and github-app social sign-in providers now pass the user's public GitHub profile to the Jsonnet data mapper as claims.raw_claims, for example login, created_at, company, and public_repos. Private account data, such as private repository counts, plan, and two-factor status, and the profile email are not included.

Login failure web hooks run when the identity is disabled

The login failure web hook now also runs when Ory Kratos Identities rejects a login because the identity is disabled. This applies to every login method that the trigger covers, including social sign-in. ctx.identity is the disabled identity, with state: "inactive", so your endpoint can tell these attempts apart from wrong credentials.

See how many backup recovery codes a user has left

Ory Kratos Identities now reports how many backup recovery codes a user has left, so your UI can remind users to generate new codes before they run out.

While an identity has backup recovery codes, the lookup_secret group of the settings flow contains a text node with the ID lookup_secret_remaining. Its message, 1050025, reads "You have 9 of 12 backup recovery codes left." and carries the counts in the remaining_codes and total_codes context fields.

After a login with a backup recovery code, the JSON response to a successful login includes a lookup_secret object with remaining_codes and total_codes. Native apps and browser apps that submit the login as JSON receive it. Logins that end in a redirect don't include it, and neither do logins that continue an OAuth2 login challenge. Ory Elements needs this version to show the count before the user reveals the codes, and to show its reminder after a login that leaves 3 or fewer codes. See Lookup Secrets.

See how many backup recovery codes a user has left

Ory Kratos Identities now reports how many backup recovery codes a user has left, so your UI can remind users to generate new codes before they run out.

While an identity has backup recovery codes, the lookup_secret group of the settings flow contains a text node with the ID lookup_secret_remaining. Its message, 1050025, reads "You have 9 of 12 backup recovery codes left." and carries the counts in the remaining_codes and total_codes context fields.

After a login with a backup recovery code, the JSON response to a successful login includes a lookup_secret object with remaining_codes and total_codes. Native apps and browser apps that submit the login as JSON receive it. Logins that end in a redirect don't include it, and neither do logins that continue an OAuth2 login challenge. See Lookup Secrets.

Webhooks and claims hooks can read the caller's network

Every Kratos webhook, the password migration hook, and the session JWT claims hook now receive ctx.asn, the number of the network (autonomous system) that the caller's IP address belongs to. It's always present, so a template written against the Ory Network keeps working on a self-hosted deployment.

Kratos reads the number from the X-Ory-Ip-Asn request header, as a decimal number without the AS prefix. Without a reverse proxy that sets this header, ctx.asn is 0. If your proxy sets it, it must replace the header on every incoming request, or a caller can choose their own network.

Webhooks and session risk rules can read the caller's network

Every Kratos webhook, the password migration hook, and the session JWT claims hook now receive ctx.asn, the number of the network (autonomous system) that the caller's IP address belongs to. Session risk rules can read the same number as request.asn, for example request.asn in [64496, 64511].

Kratos reads the number from the X-Ory-Ip-Asn request header, as a decimal number without the AS prefix. Without a reverse proxy that sets this header, ctx.asn and request.asn are 0. If your proxy sets it, it must replace the header on every incoming request, or a caller can choose their own network.

Webhooks and session risk rules can read the caller's network

Every Kratos webhook, the password migration hook, and the session JWT claims hook now receive ctx.asn, the number of the network (autonomous system) that the caller's IP address belongs to. Session risk rules can read the same number as request.asn. Ory resolves the network at the edge, so you don't have to configure anything.

ctx.asn and request.asn are always present and are 0 when the network is unknown. This template blocks sign-ups from two networks:

function(ctx)
  if std.member([64496, 64511], ctx.asn) then
    error 'sign-up is not available from this network'
  else
    { flow_id: ctx.flow.id, asn: ctx.asn }

This session risk rule revokes sessions used from the same networks:

- id: blocked-networks
  condition: |
    request.asn in [64496, 64511]
  action: revoke

See Accessing the caller's network.


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

DynamoDB moves to a driver package, and external database drivers are supported

Ory Polis now loads database drivers that are not built in. Set DB_ENGINE=custom and DB_DRIVER to the package name or path of a driver module, and pass the driver's own settings as a JSON object in DB_DRIVER_OPTIONS. A driver module exports { apiVersion, new } and implements the DatabaseDriver interface the @boxyhq/saml-jackson package exports; the API version is checked at startup. External drivers are not loaded in the FIPS 140-3 image.

Breaking change: DB_ENGINE=dynamodb is gone

The DynamoDB driver is no longer part of Ory Polis. It is the @boxyhq/polis-driver-dynamodb package, in the drivers/dynamodb directory of the Ory Polis repository, and the @aws-sdk/* packages are no longer dependencies of @boxyhq/saml-jackson. A deployment on DynamoDB has to:

  • build an image on top of the Ory Polis image that installs @boxyhq/polis-driver-dynamodb under /opt/polis-drivers, or install the package next to the @boxyhq/saml-jackson library;

  • set DB_ENGINE=custom and DB_DRIVER=@boxyhq/polis-driver-dynamodb;

  • move DB_DYNAMODB_REGION, DB_DYNAMODB_RCUS and DB_DYNAMODB_WCUS, which are removed, to DB_DRIVER_OPTIONS, for example {"region":"eu-west-1","readCapacityUnits":5,"writeCapacityUnits":5}. Library users move db.dynamodb to db.driverOptions.

The driver reads and writes the same tables and items as before, so no data migration is needed. DB_URL, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY keep their meaning.

Enterprise features need an Ory Polis Enterprise License image

Identity federation, branding, products, YugabyteDB, per-connection and additional ACS URLs for SAML connections, OpenTelemetry traces and logs and FIPS 140-3 mode are no longer part of the Ory Polis open source and CSL images or the npm package, and Polis no longer reads POLIS_LICENSE_KEY. The Identity Federation, branding and product settings APIs answer 403, sign-ins through Identity Federation apps stop working, and the Admin Portal uses the default branding. Creating or updating a SAML connection or setup link with acsUrlId, acsUrlHost or additionalAcsUrls answers 403, and Polis and its migrations refuse to start with DB_TYPE=yugabytedb.

To keep using these features, switch to the Ory Polis Enterprise License image, polis-oel or polis-oel-fips, instead of upgrading. It uses the same database and schema, so no migration is needed, and existing Identity Federation apps, branding and product settings work again unchanged.

The npm library no longer takes the polisLicenseKey option. Remove it from the options you pass. An app that embeds the npm library and registers its own OpenTelemetry TracerProvider or LoggerProvider no longer receives Polis spans or log records either.

MongoDB moves to a driver package

The MongoDB driver is no longer part of Ory Polis. It is the @boxyhq/polis-driver-mongodb package, in the drivers/mongodb directory of the Ory Polis repository, loaded through DB_ENGINE=custom, and the mongodb and migrate-mongo packages are no longer dependencies of @boxyhq/saml-jackson.

Breaking change: DB_ENGINE=mongo is gone

A deployment on MongoDB has to:

  • build an image on top of the Ory Polis image that installs @boxyhq/polis-driver-mongodb under /opt/polis-drivers, or install the package next to the @boxyhq/saml-jackson library;

  • set DB_ENGINE=custom and DB_DRIVER=@boxyhq/polis-driver-mongodb.

DB_URL keeps its meaning and the driver reads and writes the same collection and documents as before, so no data migration is needed. The Docker image's migration script does nothing for DB_ENGINE=custom: the driver creates its indexes at startup as it always did, and the one MongoDB migration, the 2023 namespace backfill, which the driver also runs at startup unless DB_MANUAL_MIGRATION=true, ships in the package for manual runs.

MongoDB is not available in the Ory Enterprise License FIPS 140-3 image, which loads no external drivers.

Redis moves to a driver package

The Redis driver is no longer part of Ory Polis. It is the @boxyhq/polis-driver-redis package, in the drivers/redis directory of the Ory Polis repository, loaded through DB_ENGINE=custom, and the redis package is no longer a dependency of @boxyhq/saml-jackson.

Breaking change: DB_ENGINE=redis is gone

A deployment on Redis has to:

  • build an image on top of the Ory Polis image that installs @boxyhq/polis-driver-redis under /opt/polis-drivers, or install the package next to the @boxyhq/saml-jackson library;

  • set DB_ENGINE=custom and DB_DRIVER=@boxyhq/polis-driver-redis.

DB_URL keeps its meaning and the driver reads and writes the same keys as before, so no data migration is needed.

Redis is not available in the Ory Enterprise License FIPS 140-3 image, which loads no external drivers. With MongoDB, Redis and DynamoDB all driver packages now, the FIPS image supports the SQL engines other than SQL Server, and PlanetScale.

Enterprise features no longer need a license key

The Ory Polis Enterprise License images always run identity federation, branding, products, OpenTelemetry logs and FIPS 140-3 mode. Polis no longer reads POLIS_LICENSE_KEY or BOXYHQ_LICENSE_KEY, and the Helm chart no longer has polis.licenseKey. Remove them from your configuration; leaving them set does nothing.

OpenTelemetry logs are now exported whenever an OTLP logs endpoint, or the general OTLP endpoint, is configured. Set OTEL_LOGS_EXPORTER=none to keep them off.

SAML logins return the asserted NameID as logoutNameId

The ID token and the userinfo response of a SAML login now include logoutNameId, the NameID exactly as the identity provider asserted it. Pass it as nameId when you start a SAML single logout. Until now you passed id or upstream_sub, which is not the NameID when the identity provider sends an id attribute or the connection sets subjectSources, so the identity provider could leave the session open.

If your identity provider sends an attribute named logoutNameId and you run Ory Polis with FLATTEN_RAW_CLAIMS, that attribute no longer appears at the top level of the claims.

SCIM group names and Identity Federation entity IDs stay unique under concurrent requests

A SCIM group's displayName is now unique within a directory. Concurrent POST requests for the same name create one group and answer the others with 409 and scimType: uniqueness. A PUT or PATCH that renames a group to a name another group in the directory already has now fails the same way and leaves the group unchanged. Before, such a rename succeeded and left two groups with the same name. One rare case remains: a failed rename that is held up for more than a minute while other groups take both of its names can leave two groups with one name. Ory Polis counts it as dsync.group.name_conflict.

An Identity Federation SAML app's entity ID is now unique across apps even when several apps are created at the same time. The check now also applies to apps created without type, which default to SAML.

A failed group PATCH no longer puts a removed member back into a group that was deleted while the request ran, or into another directory's group created under the same ID meanwhile.


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


Ory Hydra, Ory Keto, Ory Oathkeeper, Ory Elements, and Ory Terraform

No significant changes in this release.

Powered by LaunchNotes