Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate custom Back-Channel Logout filter #160

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public abstract class AbstractSingleSignOnProperties {
* client registration-id: {@code registrationId}.
*
* @see https://openid.net/specs/openid-connect-backchannel-1_0.html
* @deprecated Use built-in Spring Security support for OpenID Connect
* Back-Channel Logout
*/
@Deprecated(since = "3.1", forRemoval = true)
public static final String DEFAULT_BACKCHANNEL_LOGOUT_ROUTE = "/logout/back-channel/{"
+ BackChannelLogoutFilter.REGISTRATION_ID_URI_VARIABLE_NAME + "}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
* @author Vaadin Ltd
* @since 1.0
* @see https://openid.net/specs/openid-connect-backchannel-1_0.html
* @deprecated Use built-in Spring Security support for OpenID Connect
* Back-Channel Logout
*/
@Deprecated(since = "3.1", forRemoval = true)
public class BackChannelLogoutFilter extends GenericFilterBean {

/* Value defined by the specification */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
* @author Vaadin Ltd
* @since 1.0
* @see https://openid.net/specs/openid-connect-backchannel-1_0.html#LogoutToken
* @deprecated Use built-in Spring Security support for OpenID Connect
* Back-Channel Logout
*/
@Deprecated(since = "3.1", forRemoval = true)
public interface LogoutTokenClaimNames {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
* @author Vaadin Ltd
* @since 1.0
* @see https://openid.net/specs/openid-connect-backchannel-1_0.html#Validation
* @deprecated Use built-in Spring Security support for OpenID Connect
* Back-Channel Logout
*/
@Deprecated(since = "3.1", forRemoval = true)
public final class OidcLogoutTokenValidator
implements OAuth2TokenValidator<Jwt> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.session.SessionRegistry;
Expand Down Expand Up @@ -162,6 +163,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
// Disable CSRF for Back-Channel logout requests
final var matcher = backChannelLogoutFilter.getRequestMatcher();
http.csrf().ignoringRequestMatchers(matcher);
} else {
tamasmak marked this conversation as resolved.
Show resolved Hide resolved
http.oidcLogout().backChannel(Customizer.withDefaults());
}

return http.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Conditional;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.session.SessionRegistry;
Expand Down Expand Up @@ -158,6 +159,8 @@ protected void configure(HttpSecurity http) throws Exception {
// Disable CSRF for Back-Channel logout requests
final var matcher = backChannelLogoutFilter.getRequestMatcher();
http.csrf().ignoringRequestMatchers(matcher);
} else {
http.oidcLogout().backChannel(Customizer.withDefaults());
tamasmak marked this conversation as resolved.
Show resolved Hide resolved
}
}
}