Class CookieServerRequestCache
- java.lang.Object
-
- org.springframework.security.web.server.savedrequest.CookieServerRequestCache
-
- All Implemented Interfaces:
ServerRequestCache
public class CookieServerRequestCache extends java.lang.Object implements ServerRequestCache
An implementation ofServerRequestCache
that saves the requested URI in a cookie.- Since:
- 5.4
-
-
Constructor Summary
Constructors Constructor Description CookieServerRequestCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<java.net.URI>
getRedirectUri(org.springframework.web.server.ServerWebExchange exchange)
Get the URI that can be redirected to trigger the saved request to be usedreactor.core.publisher.Mono<org.springframework.http.server.reactive.ServerHttpRequest>
removeMatchingRequest(org.springframework.web.server.ServerWebExchange exchange)
If the providedServerWebExchange
matches the savedServerHttpRequest
gets the savedServerHttpRequest
reactor.core.publisher.Mono<java.lang.Void>
saveRequest(org.springframework.web.server.ServerWebExchange exchange)
Save theServerHttpRequest
void
setSaveRequestMatcher(ServerWebExchangeMatcher saveRequestMatcher)
Sets the matcher to determine if the request should be saved.
-
-
-
Method Detail
-
setSaveRequestMatcher
public void setSaveRequestMatcher(ServerWebExchangeMatcher saveRequestMatcher)
Sets the matcher to determine if the request should be saved. The default is to match on any GET request.- Parameters:
saveRequestMatcher
- theServerWebExchangeMatcher
that determines if the request should be saved
-
saveRequest
public reactor.core.publisher.Mono<java.lang.Void> saveRequest(org.springframework.web.server.ServerWebExchange exchange)
Description copied from interface:ServerRequestCache
Save theServerHttpRequest
- Specified by:
saveRequest
in interfaceServerRequestCache
- Parameters:
exchange
- the exchange to save- Returns:
- Return a
Mono<Void>
which only replays complete and error signals from thisMono
.
-
getRedirectUri
public reactor.core.publisher.Mono<java.net.URI> getRedirectUri(org.springframework.web.server.ServerWebExchange exchange)
Description copied from interface:ServerRequestCache
Get the URI that can be redirected to trigger the saved request to be used- Specified by:
getRedirectUri
in interfaceServerRequestCache
- Parameters:
exchange
- the exchange to obtain the savedServerHttpRequest
from- Returns:
- the URI that can be redirected to trigger the saved request to be used
-
removeMatchingRequest
public reactor.core.publisher.Mono<org.springframework.http.server.reactive.ServerHttpRequest> removeMatchingRequest(org.springframework.web.server.ServerWebExchange exchange)
Description copied from interface:ServerRequestCache
If the providedServerWebExchange
matches the savedServerHttpRequest
gets the savedServerHttpRequest
- Specified by:
removeMatchingRequest
in interfaceServerRequestCache
- Parameters:
exchange
- the exchange to obtain the request from- Returns:
- the
ServerHttpRequest
-
-