Search results for: Spring Security

In this tutorial, I will share how to generate a self-signed certificate and enable HTTPS/SSL support in a Spring Boot application. You will also learn how to configure the RestTemplate HTTP client to use the same self-signed certificate to communicate with your Web Service over HTTPS. Let’s start by generating a self-signed certificate. Generate Self-Signed…

Read More Enable HTTPs/SSL in Spring Boot App

In this tutorial, you will learn to create a Docker image for your Spring Cloud Config Server, which uses Symmetric or Asymmetric encryption to protect sensitive information. To learn how to create Spring Cloud Config that uses Symmetric encryption, read Spring Cloud Config – Symmetric Encryption and Decryption(Includes Video tutorial). And to learn how to create Spring…

Read More Docker Image for Spring Cloud Config Server

In this tutorial, you will learn how to use Asymmetric Encryption(RSA key pair) to encrypt sensitive information in configuration properties served by Spring Cloud Config Server.  Asymmetric Encryption is a stronger encryption type than symmetric encryption(shared key), but it requires a little bit more effort to set up because we need to generate an encryption key. We…

Read More Spring Cloud Config – Asymmetric Encryption and Decryption

In this tutorial, you will learn how to encrypt and decrypt a property value that is being served by Spring Cloud Config Server. The Config Server can use a symmetric (shared) key or an asymmetric one (RSA key pair). In this tutorial, we will use the symmetric key. For Asymmetric Encryption, read this tutorial: Spring Cloud…

Read More Spring Cloud Config – Symmetric Encryption and Decryption

In this tutorial, you will learn how to add Swagger or an OpenAPI support to your Spring Boot project so that you can start documenting your REST API. To be able to follow this tutorial you will need to have your REST API Spring Boot project created. If you do not have one, here is…

Read More How to Add Swagger to a Spring Boot REST API Project

In this tutorial, we will create a Spring Boot application which demonstrates how we can add and use the H2 in-memory database in our application. You will learn how an in-memory database like H2 can be used to develop a Spring boot application without the overhead of doing DB configuration on your machine and without…

Read More Using H2 In-memory Database in Spring Boot

For a complete step-by-step video course check this page: RESTful Web Services, Java, Spring Boot, Spring MVC, and JPA To learn how to build RESTful Microservices with Spring Cloud by watching step-by-step video lessons, please check this page: Spring Boot Microservices and Spring Cloud. What is Spring Framework? Introduction to Spring Boot, Create a Simple Web Service…

Read More RESTful Web Services with Spring Boot REST

In this blog post, I will share how to create a very simple RESTful Spring Boot Web Service that uses Spring Data JPA to save information to a database. Our Web Service will accept HTTP Post requests with user details and then save these user details into MySQL Database using Spring Data JPA CrudRepository. For code…

Read More Spring Boot REST and JPA – Save to a Database

In this blog post, I am going to share with you how to configure Spring Data JPA in a Jersey 2 Container Deployable Web App. Spring Data JPA makes it much easier and more convenient to persist and read data from the database and when I needed to tie together Spring Data JPA and Jersey 2 Web…

Read More Configure Spring Data JPA in Jersey 2 JAX-RS App

Create a Servlet Container deployable Jersey web application Create new Jersey web application using Maven. The project created with the below jersey-quickstart-webapp archetype can be built and deployed to a servlet container like for example Apache Tomcat. mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes \ -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.26 POM.XML Dependency to Support JSON To support JSON in your Jersey Web App add…

Read More RESTful Web Services with Jersey and Spring Data JPA – Cheat Sheet

In this tutorial, you will learn how to generate a custom JSON Web Token(JWT) and how to add and validate custom JWT Claims using the io.jsonwebtoken library. The JWT token generated in this tutorial will be signed with a SecretKey, making it secure and tamper-proof. Also, this tutorial assumes you have prior knowledge of creating…

Read More Generate JWT. Add and Validate Custom Claims.