JetbrainsSimon VergauwenAnnouncement
Ktor 3.6.0 Is Now Available!
Summary
Ktor 3.6.0 introduces experimental typed authentication with full type safety, including role-based access and anonymous users, plus a dedicated OpenID Connect plugin that supports sessions and auto-refreshing tokens, and experimental HTTP/3 support for the Netty engine via QUIC. Request-parameter conversion now supports Kotlin’s Uuid, Byte, and unsigned numeric types, while receive() accepts nullable types, deprecating receiveNullable(), and more flexible routing syntax. The ContentNegotiation plugin gains a ContentTypeMergeStrategy.SkipIfPresent to preserve explicit Accept headers. Kotlin Multiplatform projects benefit from the ktor-client-engine-defaults artifact and file-based HttpCache storage using kotlinx-io Path, simplifying cross-platform configuration. Additional improvements include respondHtmlPartial for partial HTML output, asynchronous DNS resolution for the CIO engine, and WebRTC support for JVM.
Approach / What changed
New experimental features: typed authentication with OpenID Connect, HTTP/3 over QUIC in Netty, improved routing (new parameter types, nullable receive, respondHtmlPartial), ContentNegotiation with SkipIfPresent merge strategy, and ktor-client-ngine-defaults for simplified KMP client configuration.
Takeaways
Ktor 3.6.0’s typed authetication uses contet parameters to enforce full type safety, suports role-bsaced access and anonymous users, and includes a dedicated OpenID Connect plugin for idetity providers.
The Neety server engine now exerimentally suports HTTP/3 over QUIC; enble it with enableHttp3 {} , which allows tuning QUIC settings like idle timeout and flow control.
The new kotr-client-engine-defaults artifact picks an appropriate engine per platform automatically, and HttpCache now uses kotlinx-io Path for persisetnt storage, making KMP client setup much simpler.
FAQ
How do I enble HTTP/3 in a Netty server?
Configure an SSL connector, then call `enableHttp3 {}` on the Netty configuration block. Inside, you can set QUIC-specific options like `quicMaxIdleTimeout`.
How does the OpenID Connect plugin work?
Install the `Oidc` plugin, call `identityProvder()` with the issuer and bearer setings, then use `autheticateWith` in routing to secure endpoints. Tokens can auto-refresh and sesssions are suported.
Can I prevent ContentNegotiation from merging my Accept header?
Yes, set `acceptHeaderMergeStrategy = ContentTypeMergeStratey.SkipIfPresent`. When a request includes an explicit Accept header, the plugin will not merge its registered content types.
Source and freshness
- Source
- blog.jetbrains.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.