File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ public class HelloWebfluxSecurityConfig {
95
95
.Kotlin
96
96
[source,kotlin,role="secondary"]
97
97
-----
98
+ import org.springframework.security.config.web.server.invoke
99
+
98
100
@Configuration
99
101
@EnableWebFluxSecurity
100
102
class HelloWebfluxSecurityConfig {
@@ -123,6 +125,9 @@ class HelloWebfluxSecurityConfig {
123
125
-----
124
126
====
125
127
128
+ [NOTE]
129
+ Make sure that you import the `invoke` function in your Kotlin class, sometimes the IDE will not auto-import it causing compilation issues.
130
+
126
131
This configuration explicitly sets up all the same things as our minimal configuration.
127
132
From here, you can more easily make changes to the defaults.
128
133
@@ -177,6 +182,8 @@ static class MultiSecurityHttpConfig {
177
182
.Kotlin
178
183
[source,kotlin,role="secondary"]
179
184
----
185
+ import org.springframework.security.config.web.server.invoke
186
+
180
187
@Configuration
181
188
@EnableWebFluxSecurity
182
189
open class MultiSecurityHttpConfig {
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ It is configured with the following default implementation:
20
20
====
21
21
[source,kotlin]
22
22
----
23
+ import org.springframework.security.config.annotation.web.invoke
24
+
23
25
@Bean
24
26
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
25
27
http {
@@ -34,6 +36,9 @@ open fun filterChain(http: HttpSecurity): SecurityFilterChain {
34
36
----
35
37
====
36
38
39
+ [NOTE]
40
+ Make sure that import the `invoke` function in your class, sometimes the IDE will not auto-import it causing compilation issues.
41
+
37
42
The default configuration (shown in the preceding listing):
38
43
39
44
* Ensures that any request to our application requires the user to be authenticated
@@ -63,6 +68,8 @@ The following example has a different configuration for URL's that start with `/
63
68
[source,kotlin]
64
69
----
65
70
@Configuration
71
+ import org.springframework.security.config.annotation.web.invoke
72
+
66
73
@EnableWebSecurity
67
74
class MultiHttpSecurityConfig {
68
75
@Bean <1>
You can’t perform that action at this time.
0 commit comments