Skip to content

users.ddl error #76

@c0nscience

Description

@c0nscience

Hello,

I actually try to setup a spring boot application with spring security and jdbc authentication. I set it up according to the jdbc-jc sample from the spring security samples compilation.

Here are my configs:

@Configuration
@EnableWebMvcSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private DataSource dataSource;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
            .antMatchers("/", "/home").permitAll()
            .anyRequest().authenticated();

        http.formLogin()
            .loginPage("/login")
            .permitAll()
            .and()
            .logout()
            .permitAll();
    }

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.jdbcAuthentication()
            .dataSource(dataSource)
            .withDefaultSchema()
            .withUser("admin").password("12345").roles("ADMIN");
    }
}

and the Application config

@Configuration
@ComponentScan
@EnableAutoConfiguration
@EnableJpaAuditing
@EnableJpaRepositories
@Import(RepositoryRestMvcConfiguration.class)
public class Application extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

I use a mysql database and I figured out so far that the users.ddl could never ever work on a mysql databse because there is no varchar_ignorecase statement.

Thats because the ddl script fails to build the standard user scheme.

So how do I setup a database backed user authentication?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions