@ -21,7 +21,10 @@ You will need to replace the `client-id` and `client-secret` with values registe
@@ -21,7 +21,10 @@ You will need to replace the `client-id` and `client-secret` with values registe
The next step is to instruct Spring Security that you wish to act as an OAuth2 Client so that you can obtain an access token.
@ -122,7 +122,10 @@ The `client-id` and `client-secret` are linked to the provider because `keycloak
@@ -122,7 +122,10 @@ The `client-id` and `client-secret` are linked to the provider because `keycloak
A minimal OAuth2 Login configuration is shown below:
fun webFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
return http {
oauth2Login {
authenticationConverter = converter
authenticationManager = manager
authorizedClientRepository = authorizedClients
clientRegistrationRepository = clientRegistration
}
}
}
----
====
You may register a `GrantedAuthoritiesMapper` `@Bean` to have it automatically applied to the default configuration, as shown in the following example:
[source,java]
.GrantedAuthoritiesMapper Bean
====
.Java
[source,java,role="primary"]
----
@Bean
public GrantedAuthoritiesMapper userAuthoritiesMapper() {