Date: 2026-01-06
Made by Sergei Tsõganov
Branch: internetee:hydra:develop-eeid
Target base: ory/hydra master
This document summarizes the notable changes introduced on this branch, their rationale, and migration/compatibility guidance.
- OIDC discovery document and OIDC-related behavior have been significantly simplified / hardened. Many optional discovery properties were removed or commented out; the discovery now advertises a minimal set of metadata.
- Default client scope was reduced to
openid(removedoffline_access/offlinefrom defaults). - Well-known JWKS / JWT keys exposure was aligned with the configured access token strategy.
- The OIDC userinfo behavior was changed: claim normalization, removal of many
standard JWT claims from the userinfo response, pulling
profile_attributesinto top-level claims, and settingauth_timefromiat. - Persistence of consent/login flows now consults the DB for authoritative
login_was_usedand enforceslogin_was_usedwhen persisted for some states. - Tests and snapshots were updated to reflect these behavior changes.
Versionwas bumped to2.2.- A development Dockerfile was added for local builds and a distroless runner image is provided.
Files:
oauth2/handler.gooauth2/.snapshots/TestHandlerWellKnown-hsm_enabled=false.json
What changed:
- The discovery structure (
.well-known/openid-configuration) was simplified. The following fields were removed / commented-out or significantly reduced:registration_endpointrevocation_endpointresponse_modes_supportedcode_challenge_methods_supported(PKCE methods)- back/front-channel logout support fields (
frontchannel_logout_*,backchannel_logout_*) - request object/request URI registration/claims parameter flags
- verifiable credentials / credentials endpoint metadata (commented out)
- many response types (now only
code) and grant types (now onlyauthorization_code) - token endpoint auth methods reduced to
client_secret_basic
- Two new discovery fields were added:
claim_types_supported(value example:["normal"])ui_locales_supported(value example:["et","en","ru"])
- The HTTP handler that produces discovery now returns a compact/minimal set of metadata. Many previously advertised features are intentionally not exposed any more by default.
Impact:
- Relying parties (clients) that read the discovery document to detect support
for features such as:
- dynamic client registration,
- revocation endpoint,
- PKCE methods,
- multiple grant/response types,
- logout endpoints,
- request parameter/URI features, may no longer find them in the discovery and must be configured explicitly or adjusted.
- Clients should not assume
offline_accessis part of the default scope set anymore.
Migration guidance:
- If you need discovery to advertise any of the commented/removed features, configure your deployment to add those strings back in the provider configuration (or adjust your customization of the discover handler back to the previous shape).
- Update clients that are expecting
response_types_supportedorgrant_types_supportedarrays with values other thancode/authorization_code. - If your clients rely on
token_endpoint_auth_methods_supportedcontainingclient_secret_post,private_key_jwtornone, update or reconfigure them to work withclient_secret_basicor expose those via configuration.
Files:
driver/config/provider.godriver/config/provider_test.go
What changed:
- Default client scope changed from
["offline_access", "offline", "openid"]to["openid"]. - OIDC discovery supported scope list likewise removed
offline_access/offlinefrom the defaults. - Well-known keys now include the OAuth2 JWT key only if
AccessTokenStrategyisAccessTokenJWTStrategy.
Impact:
- Any client or automation assuming offline-access/refresh token scopes are present by default must explicitly request them.
- Tests and snapshots updated accordingly.
Migration guidance:
- Explicitly request
offline_accessif you need refresh token/consent behavior. - Review code that reads
WellKnownKeysor expectshydra.jwt.access-tokento be present unconditionally.
Files:
oauth2/handler.gooauth2/handler_test.go
What changed:
- The userinfo response construction deletes/filters a lot of JWT claims
previously returned in userinfo:
- deleted:
nonce,at_hash,c_hash,exp,sid,jti,state,iat,iss,nbf,aud,rat,amr
- deleted:
auth_timeis set to the originaliatclaim.- If a
profile_attributesmap exists in the session claims it is merged into the top-level userinfo claims (except subject). - The logic that attempted to ensure
audcontained the client ID has been commented out. - Tests previously asserting on
audvalues were commented-out to align with the new behavior.
Impact:
- Userinfo responses will be leaner and will not include various JWT internals that previously might have been present.
- If systems depended on an
audclaim included in userinfo, they must not rely on it any more.
Migration guidance:
- Consumers of userinfo should be reviewed and adjusted to rely on the stable claims that remain (and/or explicitly include required claims in session attributes).
- If
audis required in userinfo for your integrations, adjust the code to add it explicitly before returning or restore the original logic guarded by appropriate configuration.
Files:
internal/httpclient/model_oidc_configuration.go
What changed:
- New JSON fields added to the OIDC configuration model used by the internal
HTTP client:
claim_types_supportedui_locales_supported
Impact:
- Clients using the internal generated client will be able to read the new properties.
Files:
persistence/sql/persister_consent.go
What changed:
- On GetLoginRequest: the DB is consulted for the canonical flow using
GetFlowand if present thelogin_was_usedfrom DB is used overriding encoded flow values. - On VerifyAndInvalidateConsentRequest: when a flow is first persisted,
login_was_usedis set to true for certain states (various FlowState* values). This ensures the persisted flow reflects the login-used status correctly. - Some debug logs (commented) were added.
Impact:
- Flows encoded in client-side tokens/challenges that may have stale
login_was_usedvalues are now reconciled with the stored DB flow. - This prevents subtle re-use or stale behavior around login usage flags.
Migration guidance:
- No configuration change required, but operators should be aware that the DB is
now considered authoritative for
login_was_used. - Review any custom persistence or flow-manipulating code to ensure compatibility with the stronger DB-driven behavior.
Files:
- Numerous
.snapshotsunderclient/,cmd/,oauth2/,cmd/,client/ - Unit tests adjusted to reflect removed fields and behaviors (aud assertions commented out; verifiable credentials checks gated on presence).
What changed:
- Snapshots updated to expect
scope: "openid"rather thanoffline_access offline openid. - Tests that previously required certain discovery elements or userinfo aud presence were either removed/commented or guarded.
Impact:
- Test behavior is aligned with the new defaults. If you run tests against a customized deployment that still advertises the earlier features, you may need to adapt snapshots or tests accordingly.
Files:
driver/config/buildinfo.go.docker/Dockerfile-dev(new)
What changed:
- Build info version string changed from
"master"to"2.2". - A
.docker/Dockerfile-devwas added which:- builds Hydra using golang:1.22 (builder stage),
- copies the binary into a distroless Debian 12 nonroot runner,
- exposes ports 4444 (public) and 4445 (admin),
- uses
hydra serve allas default command.
Impact:
- CI / developer environments can use
.docker/Dockerfile-devto produce a small runtime image for local tests. - Update any automation that depends on the
Versionstring if necessary.
- Discovery now advertises a minimal subset by default. This can break automatic
feature-detection by clients. Review all relying parties and custom
integrations that read
.well-known/openid-configuration. - Default client scopes have changed; automated client creation which assumed
refresh tokens from default scopes will no longer get them. Explicitly request
offline_accesswhere required. userinfono longer providesaudor many JWT internals by default — integrations that relied on these must be updated.- Tests and snapshots were changed to match the new defaults; if you maintain forks that expected previous defaults, align your snapshots/tests.
- If you rely on
client_secret_post,private_key_jwt, ornoneas token auth methods, they will not be advertised by default; adjust configuration or client logic.
- Review and update clients to:
- Explicitly request
offline_accesswhen refresh tokens are needed. - Avoid depending on
audbeing present in userinfo. - Avoid reliance on discovery for features that are no longer advertised by default (PKCE, registration, revocation, additional response types).
- Explicitly request
- If you need older discovery behavior, restore/extend the discover handler in your deployment or set provider config values that re-expose the necessary discovery entries.
- Rebuild or re-deploy with the new
Versionif you want to reflect the2.2label. - Run the updated test-suite and update snapshot expectations if you maintain custom tests or CI that compare snapshots.
- Added:
.docker/Dockerfile-dev
- Modified:
driver/config/buildinfo.go(Version -> 2.2)driver/config/provider.go(WellKnownKeys, DefaultClientScope, OIDCDiscoverySupportedScope)driver/config/provider_test.go(tests updated)internal/httpclient/model_oidc_configuration.go(new fields)oauth2/handler.go(discovery and userinfo logic simplified/changed)persistence/sql/persister_consent.go(login_was_used DB reconciliation and persistence logic)- Many
.snapshotsand tests acrossclient/,cmd/,oauth2/to match new behavior