|
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; |
|
48 | 48 | * A filter for the Client-side OIDC Back-Channel Logout endpoint |
49 | 49 | * |
50 | 50 | * @author Josh Cummings |
| 51 | + * @author Andrey Litvitski |
51 | 52 | * @since 6.2 |
52 | 53 | * @see <a target="_blank" href= |
53 | 54 | * "https://openid.net/specs/openid-connect-backchannel-1_0.html">OIDC Back-Channel Logout |
@@ -107,7 +108,7 @@ public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) { |
107 | 108 |
|
108 | 109 | private Mono<Void> handleAuthenticationFailure(ServerWebExchange exchange, Exception ex) { |
109 | 110 | this.logger.debug("Failed to process OIDC Back-Channel Logout", ex); |
110 | | - exchange.getResponse().setRawStatusCode(HttpServletResponse.SC_BAD_REQUEST); |
| 111 | + exchange.getResponse().setRawStatusCode(HttpStatus.BAD_REQUEST.value()); |
111 | 112 | return this.errorHttpMessageConverter.write(Mono.just(oauth2Error(ex)), ResolvableType.forClass(Object.class), |
112 | 113 | ResolvableType.forClass(Object.class), MediaType.APPLICATION_JSON, exchange.getRequest(), |
113 | 114 | exchange.getResponse(), Collections.emptyMap()); |
|
0 commit comments