MS
Size: a a a
MS
A
C
A
A
ES
A
@org.hibernate.annotations.Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
РН
PD
final BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
String passwordHash = encoder.encode("123123");
final List<GrantedAuthority>autorities = new ArrayList<GrantedAuthority>();
autorities.add(new SimpleGrantedAuthority("USER"));
authenticationManagerBuilder
.userDetailsService(customUserDetailsService)
.and()
.inMemoryAuthentication()
.passwordEncoder(new BCryptPasswordEncoder())
.withUser("DefUser")
.password(passwordHash)
.authorities(autorities);
PD
PD
RS
final BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
String passwordHash = encoder.encode("123123");
final List<GrantedAuthority>autorities = new ArrayList<GrantedAuthority>();
autorities.add(new SimpleGrantedAuthority("USER"));
authenticationManagerBuilder
.userDetailsService(customUserDetailsService)
.and()
.inMemoryAuthentication()
.passwordEncoder(new BCryptPasswordEncoder())
.withUser("DefUser")
.password(passwordHash)
.authorities(autorities);
PD
RS
@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenticated()
.and()
.formLogin()
.permitAll()
.and()
.logout()
.permitAll();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
auth
.inMemoryAuthentication()
.passwordEncoder(passwordEncoder)
.withUser("user")
.password(passwordEncoder.encode("123"))
.roles("USER");
}
}
⠀
PD
@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenticated()
.and()
.formLogin()
.permitAll()
.and()
.logout()
.permitAll();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
auth
.inMemoryAuthentication()
.passwordEncoder(passwordEncoder)
.withUser("user")
.password(passwordEncoder.encode("123"))
.roles("USER");
}
}
RS
PD