July 2018
Intermediate to advanced
268 pages
7h 36m
English
As mentioned earlier, for various testing purposes, it's better to store the user credentials and then authenticate in memory than to use a proper database, such as MySQL. For this, just change the Spring Security configuration file (SpringSecurityConfig.java) by adding the following method:
@Overrideprotected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.inMemoryAuthentication() .withUser("admin") .password("{noop}admin@password") //{noop} makes sure that the password encoder doesn't do anything .roles("ADMIN") // Role of the user .and() .withUser("user") .password("{noop}user@password") .credentialsExpired(true) .accountExpired(true) .accountLocked(true) .roles("USER");}
It's important ...
Read now
Unlock full access