In-Memory User Store Example

From NovaOrdis Knowledge Base
Revision as of 21:50, 21 October 2018 by Ovidiu (talk | contribs) (→‎Internal)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Example

@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");
    }
}