File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 33
33
</dependency >
34
34
35
35
<dependency >
36
- <groupId >org.keycloak</groupId >
37
- <artifactId >keycloak-spring-boot-starter</artifactId >
36
+ <groupId >org.keycloak</groupId >
37
+ <artifactId >keycloak-spring-boot-starter</artifactId >
38
+ <version >6.0.1</version >
38
39
</dependency >
39
40
40
41
<dependency >
75
76
<dependency >
76
77
<groupId >org.keycloak.bom</groupId >
77
78
<artifactId >keycloak-adapter-bom</artifactId >
78
- <version >3.3.0.Final </version >
79
+ <version >6.0.1 </version >
79
80
<type >pom</type >
80
81
<scope >import</scope >
81
82
</dependency >
Original file line number Diff line number Diff line change 6
6
@ SpringBootApplication
7
7
public class KeyCloakSpringSecurityApplication
8
8
{
9
-
10
9
public static void main (String [] args )
11
10
{
12
11
SpringApplication .run (KeyCloakSpringSecurityApplication .class , args );
13
12
}
14
-
15
13
}
Original file line number Diff line number Diff line change 8
8
import org .springframework .context .annotation .Bean ;
9
9
import org .springframework .context .annotation .ComponentScan ;
10
10
import org .springframework .context .annotation .Configuration ;
11
+ import org .springframework .context .annotation .FilterType ;
11
12
import org .springframework .security .config .annotation .authentication .builders .AuthenticationManagerBuilder ;
12
13
import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
13
14
import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
18
19
19
20
@ Configuration
20
21
@ EnableWebSecurity
21
- @ ComponentScan (basePackageClasses = {KeycloakSecurityComponents .class })
22
+ @ ComponentScan (basePackageClasses = {KeycloakSecurityComponents .class },
23
+ excludeFilters = @ ComponentScan .Filter (type = FilterType .REGEX , pattern = "org.keycloak.adapters.springsecurity.management.HttpSessionManager" ))
22
24
public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter
23
25
{
24
-
25
26
@ Autowired
26
27
public void configureGlobal (AuthenticationManagerBuilder authenticationManagerBuilder )
27
28
{
Original file line number Diff line number Diff line change 2
2
server :
3
3
port : 8081
4
4
5
+ # Keycloak Properties
5
6
keycloak :
6
7
auth-server-url : http://localhost:8080/auth
7
8
realm : nci
8
- resource : angular -app
9
+ resource : spring-boot -app
9
10
public-client : true
11
+ principal-attribute : preferred_username
10
12
11
13
# Spring Properties
12
14
You can’t perform that action at this time.
0 commit comments