support easy per-platform sql initialization
Author: joshlongCreated Sep 21, 2026Updated Sep 25, 2026
Labelsstatus: waiting-for-triagetype: enhancement
im doign an audit of spring security as a project to understand how and where it supports persistent, durable state in a SQL database and what the .sql files provided out of the box look like.
coudl there be a chance to make it easy to initalize-schema = always in spring boot for the various tranches?
first scan reveals the following candidates:
UserDetailsService(implemented byJdbcDaoImpl) requirescore/.../userdetails/jdbc/users.ddlUserDetailsManager,GroupManagerimplemented byJdbcUserDetailsManagerrequires te schema documented indocs/modules/ROOT/pages/servlet/appendix/database-schema.adoc:60- PersistentTokenRepository
implemented byJdbcTokenRepositoryImplrequires theCREATE_TABLE_SQLconstant atrememberme/JdbcTokenRepositoryImpl.java:42` OneTimeTokenServiceimplemented byJdbcOneTimeTokenServicerequirescore/.../core/ott/jdbc/one-time-tokens-schema.sqlAclServiceandMutableAclServiceimplemented byJdbcAclServiceandJdbcMutableAclServicerequires the.sqlfiles atacl/src/main/resources/createAclSchema*.sql(this one is in the best shape of everything)LookupStrategyimplemented byBasicLookupStrategyuses the same ACL schema as above
OAuth2AuthorizedClientServiceimplemented byJdbcOAuth2AuthorizedClientServicerequiresoauth2-client/.../oauth2-client-schema.sqland-postgres)ReactiveOAuth2AuthorizedClientServiceimplemented byR2dbcReactiveOAuth2AuthorizedClientServicerequiresoauth2-client-schema.sql(same as for blocking equivlaent)RegisteredClientRepositoryimplemented byJdbcRegisteredClientRepositoryrequires.../authorization/client/oauth2-registered-client-schema.sqlOAuth2AuthorizationServiceimplemented byJdbcOAuth2AuthorizationServicerequires.../authorization/oauth2-authorization-schema.sqlOAuth2AuthorizationConsentServiceimplemented byJdbcOAuth2AuthorizationConsentServicerequires.../authorization/oauth2-authorization-consent-schema.sqlAssertingPartyMetadataRepositoryimplemented byJdbcAssertingPartyMetadataRepositoryrequiressaml2-asserting-party-metadata-schema.sql( and-postgres.sqlvariant)
Source: spring-projects/spring-security