Git Product home page Git Product logo

spring-security-architecture-workshop's Introduction

Spring Security: The Good Parts workshop

This workshop aims to demystify how Spring Security works, show you what concepts it uses under the hood, and give you keys for fitting your own use-cases.

From the Spring Security FAQ

I have a complex scenario. What could be wrong?

You need an understanding of the technologies you intend to use before you can successfully build applications with them. Security is complicated. Setting up a simple configuration by using a login form and some hard-coded users with Spring Security’s namespace is reasonably straightforward. Moving to using a backed JDBC database is also easy enough. However, if you try to jump straight to a complicated deployment scenario like [this example scenario], you are almost certain to be frustrated. There is a big jump in the learning curve required to set up systems such as CAS, configure LDAP servers, and install SSL certificates properly. So you need to take things one step at a time.

Pre-requisites

  • Basic knowledge of Spring and Spring Boot
    • Familiarity with Spring Security is not expected, but is a plus
  • Java 17+ ; consider using SDKman to install new versions of Java
  • An HTTP client, such as curl, httpie, Postman, ...
  • Docker, for an OpenID (SSO) provider

Structure

This workshop is composed of multiple modules. Modules are self-directed work, but feel free to reach out to the instructor for questions!

Between each module, the instructor will debrief about the previous module, and introduce the following module with a bit of theory, and some new concepts.

Each module has instructions, and a self-contained project, that can be run independently from other modules.

Each module will have prompts in the various sections. Each prompt will have a solution, marked with the πŸ“– emoji. You can click on the line to expand it.

Try and answer questions by looking at the docs first, rather than looking up the solution immediately!

There are often links to the reference docs or API docs; it's usually a good idea to at least take a peek.

Lastly - ALL solutions are in the solutions branch, but don't peek, that would defeat the whole purpose of learning.

Not covered here

Sorry, we won't have the time to cover everything. We could spend a entire week if we went deep on all things! Notably, we won't cover:

  • Any specific security scheme or pattern, other than in passing (e.g. OAuth, SAML, ...)
  • Reactive-HTTP Security: it is fairly similar to Servlet. Refer to the docs
  • Testing: Testing is important, but I'm confident you'll figure it out by ... following the docs of course :)

Modules

instructor Welcome ; explain the format ; share the repository

  1. Adding Spring Security to an existing project
    • instructor πŸ—’οΈ mention WebSecurityConfigurerAdapater and lambda-DSL
    • instructor πŸ—’οΈ a word on VS Code and IntelliJ
    • instructor πŸ—’οΈ a word on IntelliJ's HTTP client
    • instructor πŸ’‘ introduce filters and filter chain
  2. Implementing your first filter
    • instructor πŸ—’οΈ walk through CsrfFilter
    • instructor πŸ—’οΈ explain how to check which filters are registered
    • instructor πŸ’‘οΈ introduce authentication and security context
  3. Adding custom authentication
    • instructor πŸ—’οΈ a word on persisting authentication between requests
    • instructor πŸ’‘ introduce use-case, why a filter would be inconvenient
  4. An authentication provider
    • instructor πŸ—’οΈ debrief auth types (HTTP Basic vs Form POST)
    • instructor πŸ’‘οΈ present configurers, examples: CSRFConfigurer, HttpBasicConfigurer
  5. Configurers (this may be optional)
    • instructor πŸ—’οΈ debrief reference docs vs configurers
    • instructor πŸ’‘οΈ explain post-processing and delegation
    • instructor πŸ’‘οΈ note: the following requires Docker, otherwise change the use-case
  6. Overloading Spring Security behavior
    • instructor πŸ’‘οΈ explain post-processing and delegation
  7. Authorization, permissions and access control
    • instructor πŸ’‘οΈ closing thoughts

spring-security-architecture-workshop's People

Contributors

kehrlann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.