Skip to content

Commit

Permalink
Merge branch '6.0.x'
Browse files Browse the repository at this point in the history
Closes gh-13103
  • Loading branch information
marcusdacoregio committed Apr 26, 2023
2 parents 8481374 + 8c5f136 commit 42cd19f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/modules/ROOT/pages/reactive/configuration/webflux.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public class HelloWebfluxSecurityConfig {
.Kotlin
[source,kotlin,role="secondary"]
-----
import org.springframework.security.config.web.server.invoke
@Configuration
@EnableWebFluxSecurity
class HelloWebfluxSecurityConfig {
Expand Down Expand Up @@ -123,6 +125,9 @@ class HelloWebfluxSecurityConfig {
-----
====

[NOTE]
Make sure that you import the `invoke` function in your Kotlin class, sometimes the IDE will not auto-import it causing compilation issues.

This configuration explicitly sets up all the same things as our minimal configuration.
From here, you can more easily make changes to the defaults.

Expand Down Expand Up @@ -177,6 +182,8 @@ static class MultiSecurityHttpConfig {
.Kotlin
[source,kotlin,role="secondary"]
----
import org.springframework.security.config.web.server.invoke
@Configuration
@EnableWebFluxSecurity
open class MultiSecurityHttpConfig {
Expand Down
7 changes: 7 additions & 0 deletions docs/modules/ROOT/pages/servlet/configuration/kotlin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,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 {
Expand All @@ -34,6 +36,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 (shown in the preceding listing):

* Ensures that any request to our application requires the user to be authenticated
Expand Down Expand Up @@ -63,6 +68,8 @@ The following example has a different configuration for URL's that start with `/
[source,kotlin]
----
@Configuration
import org.springframework.security.config.annotation.web.invoke
@EnableWebSecurity
class MultiHttpSecurityConfig {
@Bean <1>
Expand Down

0 comments on commit 42cd19f

Please sign in to comment.