commit
5632469a90
|
@ -94,6 +94,8 @@ public class HelloWebfluxSecurityConfig {
|
|||
.Kotlin
|
||||
[source,kotlin,role="secondary"]
|
||||
-----
|
||||
import org.springframework.security.config.web.server.invoke
|
||||
|
||||
@Configuration
|
||||
@EnableWebFluxSecurity
|
||||
class HelloWebfluxSecurityConfig {
|
||||
|
@ -122,6 +124,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 easily make the changes to the defaults.
|
||||
|
||||
|
@ -176,6 +181,8 @@ static class MultiSecurityHttpConfig {
|
|||
.Kotlin
|
||||
[source,kotlin,role="secondary"]
|
||||
----
|
||||
import org.springframework.security.config.web.server.invoke
|
||||
|
||||
@Configuration
|
||||
@EnableWebFluxSecurity
|
||||
open class MultiSecurityHttpConfig {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue