|
1 | 1 | /* |
2 | | - * Copyright 2002-2023 the original author or authors. |
| 2 | + * Copyright 2002-2025 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
18 | 18 |
|
19 | 19 | import java.util.Collections; |
20 | 20 |
|
21 | | -import jakarta.servlet.http.HttpServletResponse; |
22 | 21 | import org.apache.commons.logging.Log; |
23 | 22 | import org.apache.commons.logging.LogFactory; |
24 | 23 | import reactor.core.publisher.Mono; |
25 | 24 |
|
26 | 25 | import org.springframework.core.ResolvableType; |
| 26 | +import org.springframework.http.HttpStatus; |
27 | 27 | import org.springframework.http.MediaType; |
28 | 28 | import org.springframework.http.codec.EncoderHttpMessageWriter; |
29 | 29 | import org.springframework.http.codec.HttpMessageWriter; |
|
47 | 47 | * A filter for the Client-side OIDC Back-Channel Logout endpoint |
48 | 48 | * |
49 | 49 | * @author Josh Cummings |
| 50 | + * @author Andrey Litvitski |
50 | 51 | * @since 6.2 |
51 | 52 | * @see <a target="_blank" href= |
52 | 53 | * "https://openid.net/specs/openid-connect-backchannel-1_0.html">OIDC Back-Channel Logout |
@@ -108,7 +109,7 @@ public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) { |
108 | 109 |
|
109 | 110 | private Mono<Void> handleAuthenticationFailure(ServerWebExchange exchange, Exception ex) { |
110 | 111 | this.logger.debug("Failed to process OIDC Back-Channel Logout", ex); |
111 | | - exchange.getResponse().setRawStatusCode(HttpServletResponse.SC_BAD_REQUEST); |
| 112 | + exchange.getResponse().setRawStatusCode(HttpStatus.BAD_REQUEST.value()); |
112 | 113 | return this.errorHttpMessageConverter.write(Mono.just(oauth2Error(ex)), ResolvableType.forClass(Object.class), |
113 | 114 | ResolvableType.forClass(Object.class), MediaType.APPLICATION_JSON, exchange.getRequest(), |
114 | 115 | exchange.getResponse(), Collections.emptyMap()); |
|
0 commit comments