Inlägg

Visar inlägg från april, 2023

Spring Boot 3 with Open API

 Spring Boot 3 with Open API  I thought it was hard to find a good example how to implement Open API with Spring Boot 3 and I made a repository at Github with an simple implementation. You find it here https://github.com/AIMMOTH/spring-boot-3 Maven Add the following dependencies and plugin in pom.xml:

Spring Boot 3 with CORS and CSP

 Spring Boot 3 with CORS and CSP Honestly I thought it was very difficult implementing CORS and CSP. But I had done it before with Servlet API and realized you could do the same by using a jakarta.servlet.Filter. You can find the code here  https://github.com/AIMMOTH/spring-boot-3/tree/auth0-cors-csp-security Request  After reading Baeldung's blog it was easy to implement the 2 different filters. For the request I use a component with a high order and checks the request origins:

Spring Boot 3 with Auth0

  Spring Boot 3 with Auth0 Spring Boot 3 is using Spring Security 6 which have some updates. To get Auth0 JWT access token to work I created this simple Github repository. You can find it in this branch https://github.com/AIMMOTH/spring-boot-3/tree/auth0-security Auth0 SecurityFilterChain This repository contains a class with @Configuration and @EnableWebSecurity and matches on request to determine to authorize or permit all. See whole example below:

Spring Boot 3 Implementation

 Spring Boot 3 Implementation Simple implementation with core technology Spring Boot 3 is out and I wanted to implement some core technology as a blue print for future projects.  Spring Boot 3 with... The following technology is implemented and tested in this project: Open API with path and components Controller implementing generated Open API interfaces Maven project Autowired Service Component, for utils WebSocket, configuration and handler Properties, using YAML file JUnit 5 Mockito Lombok Static web files JavaScript for WebRTC client (from Baeldung blog ) Simple HTML form with JavaScript listeners Auth0 4.4 JWT access and Id token CORS CSP Secure WebSocket GitHub Repository You can find my repository at https://www.github.com/AIMMOTH/spring-boot-3 Carl 2023