diff --git a/config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java b/config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java index d75e02ceb6..1f5ee74b77 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java +++ b/config/src/main/java/org/springframework/security/config/annotation/authentication/builders/AuthenticationManagerBuilder.java @@ -138,19 +138,31 @@ public class AuthenticationManagerBuilder extends AbstractConfiguredSecurityBuil /** * Add JDBC authentication to the {@link AuthenticationManagerBuilder} and - * return a {@link JdbcUserDetailsManagerConfigurer} to allow customization of the - * JDBC authentication. + * return a {@link JdbcUserDetailsManagerConfigurer} to allow customization + * of the JDBC authentication. + * + *
+ * When using with a persistent data store, it is best to add users external + * of configuration using something like Flyway or Liquibase to create the schema and + * adding users to ensure these steps are only done once and that the + * optimal SQL is used. + *
* ** This method also ensure that a {@link UserDetailsService} is available * for the {@link #getDefaultUserDetailsService()} method. Note that * additional {@link UserDetailsService}'s may override this - * {@link UserDetailsService} as the default. + * {@link UserDetailsService} as the default. See the User Schema section of the reference for the default schema. *
* - * @return a {@link JdbcUserDetailsManagerConfigurer} to allow customization of the - * JDBC authentication - * @throws Exception if an error occurs when adding the JDBC authentication + * @return a {@link JdbcUserDetailsManagerConfigurer} to allow customization + * of the JDBC authentication + * @throws Exception + * if an error occurs when adding the JDBC authentication */ public JdbcUserDetailsManagerConfigurer