In-Memory User Store Example

From NovaOrdis Knowledge Base
Revision as of 21:49, 21 October 2018 by Ovidiu (talk | contribs) (Created page with "=Internal= * Spring Security Concepts <syntaxhighlight lang='java'> @Configuration @EnableWebSecurity public class Security...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {

        auth.
           inMemoryAuthentication().
                withUser("alice").
                password("alice123").
                authorities("ROLE_USER").
                and().
                withUser("bob").
                password("bob123").
                authorities("ROLE_USER");
    }
}