Problem Given a Spring Boot application that exposes a REST API, we want to control access to one of its API endpoints using HTTP basic authentication. HTTP basic authentication HTTP basic authentication is an extension to the HTTP protocol meant to protect access to a web resource. It works defining a username and password forContinue reading “How to secure an API endpoint with HTTP basic authentication in Spring Boot”
Tag Archives: Java
Setting up HTTPS / SSL in a Spring Boot Web application
Problem We want to be able to exchange HTTP requests and responses with our application over an encrypted connection. HTTPS and SSL SSL (Secure Sockets Layer) is a standard for secure communication over the transport layer. It defines a set of protocols and algorithms via which a client can establish an encrypted communication channel toContinue reading “Setting up HTTPS / SSL in a Spring Boot Web application”
Logging configuration in Spring Boot
Problem Spring Boot creates a default logging infrastructure with SLFJ as an abstraction layer over Logback. This works, but the default configuration logs with debug level and is overly verbose when using other libraries like JDBC and WebClient. We want to configure the log level with a configuration file to show the logs of ourContinue reading “Logging configuration in Spring Boot”
How to integrate a Java application with the AWS Java SDK
Problem Given a Java application that runs in an EC2 instance, we want to enable it to call AWS services. This is useful for example to call services like Secrets Manager to retrieve secrets. Authentication with AWS services when running locally When running locally, the SDK has several ways of obtaining the credentials. We willContinue reading “How to integrate a Java application with the AWS Java SDK”
Integration Testing with Karate Framework
What is Karate? Karate is a framework for integration testing. It’s relevant to understand that although Karate borrows some concepts from Cucumber and BDD (Behavior Driven Development), it is not a framework for BDD. See Peter Thomas’ answer about this for more details. Architecture of a Karate program A Karate program is a Java programContinue reading “Integration Testing with Karate Framework”