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

Add UserBuilder #4095

Closed
rwinch opened this issue Oct 18, 2016 · 0 comments
Closed

Add UserBuilder #4095

rwinch opened this issue Oct 18, 2016 · 0 comments
Assignees
Milestone

Comments

@rwinch
Copy link
Member

rwinch commented Oct 18, 2016

This will make it easier to define users without AuthenticationManagerBuidler. For example:

@Bean
public UserDetailsManager userDetailsManager() throws Exception {
    InMemoryUserDetailsManager manager = new InMemoryUserDetailsManager();
    manager.createUser(User.withUsername("user").password("password").roles("USER").build());
    manager.createUser(User.withUsername("admin").password("password").roles("USER","ADMIN").build());
    return manager;
}
@Bean
public UserDetailsManager userDetailsManager(DataSource dataSource) throws Exception {
    JdbcUserDetailsManager result = new JdbcUserDetailsManager(dataSource);
    result.createUser(User.withUsername("user").password("password").roles("USER").build());
    result.createUser(User.withUsername("admin").password("password").roles("USER","ADMIN).build());
    return result;
}
----
@rwinch rwinch added this to the 4.2.0 RC1 milestone Oct 18, 2016
@rwinch rwinch changed the title UserDetailsService Builder UserDetailsService Builders Oct 18, 2016
@rwinch rwinch changed the title UserDetailsService Builders Add UserBuilder Oct 21, 2016
@rwinch rwinch self-assigned this Oct 21, 2016
@rwinch rwinch closed this as completed in f432c04 Oct 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant