You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`OidcLogoutAuthenticationValidator` is the default validator used for validating specific OpenID Connect Logout request parameters used in the RP-Initiated Logout flow.
560
+
`OidcLogoutAuthenticationValidator` is the default validator used for validating specific OpenID Connect RP-Initiated Logout Request parameters.
561
561
The default implementation validates the `post_logout_redirect_uri` parameter.
562
562
If validation fails, an `OAuth2AuthenticationException` is thrown.
563
563
564
564
`OidcLogoutAuthenticationProvider` provides the ability to override the default logout request validation by supplying a custom authentication validator of type `Consumer<OidcLogoutAuthenticationContext>` to `setAuthenticationValidator()`.
565
565
566
+
[TIP]
567
+
`OidcLogoutAuthenticationContext` holds the `OidcLogoutAuthenticationToken`, which contains the logout request parameters.
568
+
566
569
[IMPORTANT]
567
570
If validation fails, the authentication validator *MUST* throw `OAuth2AuthenticationException`.
568
571
572
+
The following example shows how to configure `OidcLogoutAuthenticationProvider` with a custom authentication validator:
573
+
574
+
[source,java]
575
+
----
576
+
@Bean
577
+
public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception {
Copy file name to clipboardExpand all lines: oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/oidc/authentication/OidcLogoutAuthenticationContext.java
Copy file name to clipboardExpand all lines: oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/oidc/authentication/OidcLogoutAuthenticationProvider.java
+2-2
Original file line number
Diff line number
Diff line change
@@ -188,7 +188,7 @@ public boolean supports(Class<?> authentication) {
188
188
/**
189
189
* Sets the {@code Consumer} providing access to the
190
190
* {@link OidcLogoutAuthenticationContext} and is responsible for validating specific
191
-
* Open ID Connect RP-Initiated Logout Request parameters associated in the
191
+
* OpenID Connect RP-Initiated Logout Request parameters associated in the
192
192
* {@link OidcLogoutAuthenticationToken}. The default authentication validator is
193
193
* {@link OidcLogoutAuthenticationValidator}.
194
194
*
@@ -197,7 +197,7 @@ public boolean supports(Class<?> authentication) {
197
197
* {@link OAuth2AuthenticationException} if validation fails.
198
198
* @param authenticationValidator the {@code Consumer} providing access to the
199
199
* {@link OidcLogoutAuthenticationContext} and is responsible for validating specific
200
-
* Open ID Connect RP-Initiated Logout Request parameters
Copy file name to clipboardExpand all lines: oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/oidc/authentication/OidcLogoutAuthenticationValidator.java
Copy file name to clipboardExpand all lines: oauth2-authorization-server/src/test/java/org/springframework/security/oauth2/server/authorization/oidc/authentication/OidcLogoutAuthenticationProviderTests.java
+2-2
Original file line number
Diff line number
Diff line change
@@ -317,7 +317,7 @@ public void authenticateWhenInvalidPostLogoutRedirectUriThenThrowOAuth2Authentic
0 commit comments