Clarify that Kotlin DSL needs an import

Closes gh-13092
This commit is contained in:
Marcus Da Coregio
2023-04-26 15:56:47 -03:00
parent caa4093619
commit e61adcb0cd
2 changed files with 14 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ It is configured with the following default implementation:
[source,kotlin]
----
import org.springframework.security.config.annotation.web.invoke
@Bean
open fun filterChain(http: HttpSecurity): SecurityFilterChain {
http {
@@ -29,6 +31,9 @@ open fun filterChain(http: HttpSecurity): SecurityFilterChain {
}
----
[NOTE]
Make sure that import the `invoke` function in your class, sometimes the IDE will not auto-import it causing compilation issues.
The default configuration above:
* Ensures that any request to our application requires the user to be authenticated
@@ -54,6 +59,8 @@ For example, the following is an example of having a different configuration for
[source,kotlin]
----
import org.springframework.security.config.annotation.web.invoke
@EnableWebSecurity
class MultiHttpSecurityConfig {
@Bean <1>