Kotlin Chats in Telegram:
RU https://kug.community/
EN https://kug.community/en
Kotlin news and tips
Post #645
313
Ktor
Ktor 3.6.0 brings typed authentication, OpenID Connect, HTTP/3 for Netty and simpler Kotlin Multiplatform clients.
Major changes:
1. Typed authentication — experimental. Context parameters carry the principal type from the authentication provider into the route. With
2. OpenID Connect — experimental. The new
3. HTTP/3 for Netty — experimental. Configure an SSL connector, then opt in with
4. Less setup for KMP clients. Add
5. More expressive request handling. Parameter conversion now supports Kotlin's
6. Keep an explicit Accept header. Set
Also in this release.
Announcement · What's new
3.6.0Ktor 3.6.0 brings typed authentication, OpenID Connect, HTTP/3 for Netty and simpler Kotlin Multiplatform clients.
Major changes:
1. Typed authentication — experimental. Context parameters carry the principal type from the authentication provider into the route. With
jwt<User>(...), call.principal is a User inside authenticateWith(jwtAuth). The API also supports role checks and anonymous users — KTOR-97852. OpenID Connect — experimental. The new
Oidc plugin adds typed authentication providers, sessions and browser login with automatically refreshed tokens — KTOR-9841, KTOR-85963. HTTP/3 for Netty — experimental. Configure an SSL connector, then opt in with
enableHttp3 { }. The block exposes QUIC settings such as idle timeouts and flow-control limits. Netty can also serve cleartext HTTP/2 (h2c) and HTTP/2 over TLS on separate connectors in the same server — What's new, KTOR-96434. Less setup for KMP clients. Add
ktor-client-engine-defaults to commonMain, then create HttpClient(): the dependency supplies a curated set of engines, and Ktor selects one for each target. File-based HttpCache storage now uses kotlinx-io's Path, moving it beyond JVM-only java.io.File APIs — KTOR-9645, KTOR-97355. More expressive request handling. Parameter conversion now supports Kotlin's
Uuid, Byte and unsigned numeric types. call.receive<Preferences?>() accepts a nullable type directly; receiveNullable() is deprecated — KTOR-7468, KTOR-55776. Keep an explicit Accept header. Set
acceptHeaderMergeStrategy = ContentTypeMergeStrategy.SkipIfPresent in client ContentNegotiation to preserve a request's own Accept header. Requests without one still get the registered content types — KTOR-5009Also in this release.
respondHtmlPartial replaces the deprecated respondHtmlFragment for unrestricted partial HTML. There is also WebRTC support for JVM, asynchronous DNS resolution for CIO, OpenAPI tag descriptions and JavaScript fetch() overrides.Announcement · What's new
- 🔥 3