Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

users.ddl error #76

Closed
c0nscience opened this issue Mar 12, 2014 · 2 comments
Closed

users.ddl error #76

c0nscience opened this issue Mar 12, 2014 · 2 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@c0nscience
Copy link

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?

@rwinch
Copy link
Member

rwinch commented Apr 28, 2014

I have create a JIRA to track this here https://jira.spring.io/browse/SEC-2532

@rwinch
Copy link
Member

rwinch commented Apr 28, 2014

Resolved per my comment on the JIRA.

NOTE This is NOT going to work for every database. See the discussion on the JIRA for details

@rwinch rwinch closed this as completed Apr 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants