Skip to content

fengshch/Spring-Security-Fourth-Edition

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Security - Fourth Edition

This is the code repository for Spring Security - Fourth Edition, published by Packt.

Effectively secure your web apps, RESTful services, cloud apps, and microservice architectures

What is this book about?

Knowing that experienced hackers are constantly on the prowl to attack your apps can make security one of the most challenging concerns of creating an app. The complexity of properly securing an app is compounded when you must also integrate this factor with legacy code, new technologies, and other frameworks. This book will help you easily secure your Java apps with Spring Security, a trusted and highly customizable authentication and access control framework.

This book covers the following exciting features:

  • Understand common security vulnerabilities and how to resolve them
  • Implement authentication and authorization and learn how to map users to roles
  • Get to grips with the security challenges of RESTful web services and microservices
  • Configure Spring Security to use Spring Data for authentication
  • Integrate Spring Security with Spring Boot, Spring Data, and web applications
  • Protect against common vulnerabilities like XSS, CSRF, and Clickjacking

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

//src/main/java/com/packtpub/springsecurity/configuration/
SecurityConfig.java
@Bean
public SecurityFilterChain filterChain(HttpSecurity http,
       PersistentTokenRepository persistentTokenRepository,
RememberMeServices rememberMeServices) throws Exception {
    http.authorizeHttpRequests( authz -> authz
                .requestMatchers("/webjars/**").permitAll()
…
    // Remember Me
    http.rememberMe(httpSecurityRememberMeConfigurer -> 
httpSecurityRememberMeConfigurer
          .key("jbcpCalendar")
          .rememberMeServices(rememberMeServices)
          .tokenRepository(persistentTokenRepository));
    return http.build();
}

Following is what you need for this book:

If you’re a Java web developer or an architect with fundamental knowledge of Java 17/21, web services, and the Spring Framework, this book is for you. No previous experience with Spring Security is needed to get started with this book.

With the following software and hardware list you can run all code files present in the book (Chapter 1-19).

Software and Hardware List

Chapter Software required OS required
1-19 IntelliJ IDEA and Eclipse are both popular choices for Spring development Windows, macOS, or Linux
1-19 JDK versions: 17 or 21 Windows, macOS, or Linux
1-19 Spring- Security 6. Windows, macOS, or Linux
1-19 Spring- Boot 3. Windows, macOS, or Linux
1-19 Thymeleaf 6. Windows, macOS, or Linux

JBCP Calendar Application

Chapters


  1. Anatomy of an Unsafe Application

  1. Getting Started with Spring Security

  1. Custom Authentication

  1. JDBC-Based Authentication

  1. Authentication with Spring-Data

  1. LDAP Directory Services

  1. Remember-Me Services

  1. Client Certificate Authentication with TLS

  1. Opening up to OAuth 2

  1. SAML 2 Support

  1. Fine-grained Access Control

  1. Access Control Lists

  1. Custom Authorization

  1. Session Management

  1. Additional Spring Security Features

  1. Migration to Spring Security 6

  1. Microservice Security with OAuth 2 and JSON Web Tokens

  1. Single Sign-On with the Central Authentication Service

  1. Build GraalVM native images

Related products

Get to Know the Author

Badr Nasslahsen is a lead security and cloud architect with over 17 years of experience. He holds an executive master’s degree from Ecole Centrale Paris and an engineering degree from Telecom SudParis. He is an Oracle Certified Java SE 11 Professional, CISSP, TOGAF, CKA, and Scrum master. Badr has extensive experience in public cloud providers: AWS, Azure, GCP, Oracle, and IBM. He is also the author of the springdoc-openapi project.

About

Spring Security Fourth Edition, published by Packt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 72.5%
  • HTML 26.9%
  • Shell 0.2%
  • Smarty 0.2%
  • CSS 0.1%
  • JavaScript 0.1%