What a build contains

What a build of an application with spring_boot_starter_security contains, and when something is not in it. A module that follows a key reads it when build_runner runs, from application.yml or application.properties without a profile (see Modules left out of the build). The modules of the packages it depends on come with it: for spring_boot_dart, see Auto-configuration.

Always in

No build: and no platform:: in every build of an application that depends on the starter.

Module What it holds
springSecurityCoreAutoConfiguration (spring_security_core) Method security for the annotations, the authentication event publisher and the AuthenticationManager built from the application's user store. methodSecurityValidator, which stops the start for a secured bean left without a proxy, is in it and stays in every build on purpose: it is a safety net of security.

By platform

platform:: the module is only in the build of that platform; no property is read.

Module Platform What it holds
springBootStarterSecurityAutoConfiguration native The security filter, the default filter chain and user, the JWT decoder from the properties, the authorized client repository of oauth2Login() and the controller argument resolver.
springBootStarterSecurityOAuth2ClientAutoConfiguration native The ID token decoder of servers (oidcIdTokenDecoder), which checks signatures with the provider's keys and takes the place of the OAuth2 client starter's default.

native: builds where dart:io exists (a server, an AOT executable, a Flutter app on a phone or a desktop), not a browser build. server: native without Flutter, never a Flutter app. -DSPRING_ALL_PLATFORMS=true keeps every module.

What the generator writes for it

A part of the generator (see Starter parts) runs only when the application reaches its package.

Part or builder What it does
Security part (spring_security_core) Writes nothing: says where the expressions of @PreAuthorize, @PostAuthorize, @PreFilter and @PostFilter look, so the classes they reach are described.
Through its dependencies The web part and the actuator part, since the starter depends on spring_web_dart and spring_boot_actuator.

Good to know

See also