Spring Boot 3 and Keycloak with Oauth2 Resource Server (JWT) for REST...
IntroductionSpring Security OAuth2 Login does NOT support authentication with Access Token that you might first think....
View ArticleSpring Boot 3 and Keycloak with Oauth2 Log in (Authorization Code Grant) for...
IntroductionSee https://magnus-k-karlsson.blogspot.com/2023/08/spring-boot-3-spring-security-6.htmlPrerequisiteJava 17Maven 3.6.3 or laterSpring 3.1.2Spring Security 6.1.2Keycloak. I will use the...
View ArticleSpring Boot 3 and Keycloak with Oauth2 Log in (Authorization Code Grant) for...
IntroductionSee Spring Boot 3 and Keycloak with Oauth2 Log in (Authorization Code Grant) for Angular SPASee Spring Boot 3 and Keycloak with Oauth2 Resource Server (JWT) for REST integrationHere we will...
View ArticleSpring Boot 3 and Keycloak with Oauth2 Log in (Authorization Code Grant) and...
IntroductionUsing BASIC authentication when requesting Access Token in OAUth 2 Authorization Code Flow is not the safest way. Especially if this password is rarely changed.See Spring Boot 3 and...
View ArticleOauth 2.0 Client Credentials Grant
Used for machine-to-machine communicationClient needs to hold secrets, since Access Token is directly exposedhttps://datatracker.ietf.org/doc/html/rfc6749#section-4.4.2 POST /token HTTP/1.1 Host:...
View ArticleSpring Boot 3 with Basic Authentication and JDBC Password Storage
Create new Maven ProjectCreate new project with Spring Initializr (https://start.spring.io/) and add dependency: Spring Data JDBC and MySQL<dependency>...
View ArticleUsing Java 17 keytool as Root CA to create Server and User Certificate
Referencehttps://docs.oracle.com/en/java/javase/17/docs/specs/man/keytool.htmlhttps://magnus-k-karlsson.blogspot.com/2020/02/x509-certificate-profiles.htmlRoot CAGenerate Self Signed Root CA$ keytool...
View ArticleSpring Boot 3 with X509 Authentication and JDBC Storage
Referencehttps://docs.spring.io/spring-security/reference/servlet/authentication/x509.htmlhttps://magnus-k-karlsson.blogspot.com/2023/08/using-java-17-keytool-as-root-ca-to.htmlhttps://magnus-k-karlsso...
View ArticleOpenLDAP Image and Custom LDIF with User and Group
Reference: https://hub.docker.com/r/bitnami/openldapLDAP_PORT_NUMBER: The port OpenLDAP is listening for requests. Priviledged port is supported (e.g. 1389). Default: 1389 (non privileged port)....
View ArticleKeycloak, User Federation from LDAP and Lesson Learned
LDAPWe are going to use OpenLDAP and setup in previous blog OpenLDAP Image and Custom LDIF with User and Group.$ podman run -d --name openldap \ -e LDAP_ROOT=dc=magnuskkarlsson,dc=se \ -e...
View ArticleSpring RestTemplate and WebClient Improvements
Improvements for reactive WebClienthttps://medium.com/@dixitsatish34/how-to-improve-webclient-response-time-in-spring-boot-3c0c898f06b4Improvements for blocking...
View ArticleIPv4 Network Ranges
Example 192.168.0.0/30number of IP addresses = 2 ^ (32–30)which is 2 ^ 2 = 4The IP addresses are thus 192.168.0.0, 192.168.0.1, 192.168.0.2 and 192.168.0.3Example 192.168.0.0/29number of IP addresses =...
View ArticleCORS Finally Explained — Simply
https://levelup.gitconnected.com/cors-finally-explained-simply-ae42b52a70a3
View ArticleInstallation of HAProxy and Keepalived for High Availability
https://medium.com/@kemalozz/installation-of-haproxy-and-keepalived-for-high-availability-f1d6e7b8982a
View ArticleDifferences between Load Balancer, Reverse Proxy and API Gateway
https://medium.com/codenx/load-balancer-vs-reverse-proxy-vs-api-gateway-fcb79912abbf
View ArticleGeneric Exception Handling in Spring Boot
https://blog.stackademic.com/top-10-ways-to-handle-exception-in-springboot-with-coding-examples-ac27fad937ca
View ArticleSwagger Like a Pro with Spring Boot 3 and Java 17
https://medium.com/@berktorun.dev/swagger-like-a-pro-with-spring-boot-3-and-java-17-49eed0ce1d2f
View ArticleMastering Exception Handling in Spring Boot: A Comprehensive Guide
https://naveen-metta.medium.com/mastering-exception-handling-in-spring-boot-a-comprehensive-guide-fa3f916d1981
View ArticleMastering Lombok in Spring Boot for Efficient Java Development
https://medium.com/@tecnicorabi/mastering-lombok-in-spring-boot-for-efficient-java-development-8f79828c0519
View ArticleConfigure mTLS/Two-Way SSL/Client Certificate Authentication with Spring Boot...
IntroductionIn this blog I'm configure mTLS also called Two-Way SSL or Client Certificate Authentication, with self signed certificate.Server Certificate (self signed)$ keytool -genkeypair -alias...
View ArticleWriting mTLS/Two-Way SSL/Client Certificate Authentication with Spring Boot 4...
IntroductionIn my previous I setup the server side with mLTS https://magnus-k-karlsson.blogspot.com/2026/04/configure-mtlstwo-way-sslclient.htmlSSL Bundleapplication.properties#...
View ArticleWriting mTLS/Two-Way SSL/Client Certificate Authentication with Spring Boot...
IntroductionIn my previous I setup client certification authentication with RestClient https://magnus-k-karlsson.blogspot.com/2026/04/writing-mtlstwo-way-sslclient.htmlHere I will use new Spring Boot 4...
View ArticleHow to Install Docker CE on Fedora 43
Prerequisite$ cat /etc/os-release ... VERSION="43 (Workstation Edition)" ... Install Docker CE (Community Edition)https://docs.docker.com/engine/install/fedora/Remove possible old version of Docker CE$...
View ArticleGIT Rebase
1. Check out your main branch:$ git checkout mainReference: https://docs.gitlab.com/topics/git/git_rebase/2. "Ensure you have the latest contents of the target branch. In this example, the target...
View Article