Basic auth with Ktor

Conquer Authentication with Ktor: Part 2 – Basic Authentication

Welcome to the latest chapter in our ongoing series about implementing authentication with Ktor. Having laid a solid foundation by covering the fundamentals of Ktor, we’re now prepared to delve into the realm of security protocols. In today’s post, we’re going to start with the simplest one – Basic Authentication. We’ll unpack how this protocol functions and guide you through its implementation using Ktor.

Authentication with Ktor

Launching a Guide to Conquer Authentication with Ktor

Welcome to the first post on the subject of authentication with Ktor. As developers, we appreciate the importance of security, but integrating it smoothly within our backend services can sometimes seem like a daunting task. However, when working with Kotlin and Ktor, the task becomes much more approachable due to concise syntax and flexibility. This series aims to delve into the diverse authentication mechanisms. We will find our way through Basic Auth, Form Auth, to more complex ones like JWT and OAuth. Whether you’re new to Ktor or looking to broaden your horizons, this series will offer practical, hands-on experiences to help you effectively bring security to your backend applications.

Featured image

Streamlining Console Output Verification with Kotest

Console logging is often perceived as a bad practice, but in specific contexts, it’s quite suitable. Consider a scenario of a workshop where printing output directly to the console enhances transparency and simplifies the project setup. Using a comprehensive logger could lead to unnecessary clutter. However, there’s a downside to directly printing to the console—it makes it challenging to verify the result. Well, at least so I thought until I accidentally stumbled upon this awesome article by Thijs Kaper. Although Spring Boot provides out-of-the-box support for output verification, it’s also possible, and sometimes preferable, to implement it independently. In this blog post, I’ll demonstrate how to create a custom spec in Kotest that you can leverage in your tests. This spec automatically captures console output and provides the result for verification.

Generate Kotlin tests with EasyCode and ChatGPT

Leveraging AI to Simplify Test Writing in IntelliJ

Today, I would like to share a quick productivity tip. As developers, we sometimes skip writing extensive tests, particularly when under time pressure. As much as tests are necessary, they can also be tedious to write. For example, due to learning a new testing framework or when dealing with intricate business logic. Furthermore, this task often involves a certain degree of repetitive boilerplate, which can be a considerate discouragement for some developers. In this post, we’ll explore how generative AI saves time and effort without compromising on quality of writing detailed tests.