File tree 2 files changed +10
-1
lines changed
java/com/pyr/security/config 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
package com .pyr .security .config ;
2
2
3
3
import org .springframework .context .annotation .Configuration ;
4
+ import org .springframework .security .config .annotation .authentication .builders .AuthenticationManagerBuilder ;
4
5
import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
5
6
import org .springframework .security .config .annotation .web .builders .WebSecurity ;
6
7
import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
7
8
import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
9
+ import org .springframework .security .crypto .bcrypt .BCryptPasswordEncoder ;
8
10
9
11
@ Configuration
10
12
@ EnableWebSecurity
11
13
public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
14
+
15
+ @ Override
16
+ protected void configure (AuthenticationManagerBuilder auth ) throws Exception {
17
+ auth .inMemoryAuthentication ().passwordEncoder (new BCryptPasswordEncoder ()).withUser ("admin" ).password (new BCryptPasswordEncoder ().encode ("111" )).roles ("USER" );
18
+ auth .inMemoryAuthentication ().passwordEncoder (new BCryptPasswordEncoder ()).withUser ("pyr" ).password (new BCryptPasswordEncoder ().encode ("pyr" )).roles ("ADMIN" );
19
+ }
20
+
12
21
@ Override
13
22
protected void configure (HttpSecurity http ) throws Exception {
14
23
http .authorizeRequests ()
Original file line number Diff line number Diff line change 1
-
1
+ server.port =8087
You can’t perform that action at this time.
0 commit comments