Spring Security

Spring Boot Role-Based Authentication with AWS Cognito

Spring Security framework supports a wide range of authentication models, and in this tutorial, we will cover OAuth2 authentication using Amazon Cognito. We will walk through a step-by-step guide from creating the user pool in the AWS, adding the app client, and configuring it in the Spring Boot application. 1. …

Spring Security Interview Questions

If you’re preparing for a job interview, these Spring security interview questions will help you understand key concepts and increase the confidence.

WebSecurityConfigurerAdapter Deprecated: Migration Guide

WebSecurityConfigurerAdapter was deprecated in Spring Security 5.7 and removed in 6.0. Replace it with a SecurityFilterChain bean, requestMatchers, a PasswordEncoder bean, WebSecurityCustomizer and @EnableMethodSecurity on Spring Boot 4, with tests.

Spring Security Context Propagation to Threads

Learn to pass the Spring SecurityContext instance to new threads either spawned by Spring @Async or created explicitly using new Runnable or Callable instances. 1. Default Strategy is ThreadLocal Once the AuthenticationManager completes the authentication process successfully, it stores the Authentication instance for the rest of the request in the …

Password Encoders in Spring Security

Learn the contract spring security expects from PasswordEncoder interface, inbuilt implementations and DelegatingPasswordEncoder with examples.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.