Package com.vaadin.flow.spring.security
Interface VaadinSavedRequestAwareAuthenticationSuccessHandler.SuccessUrlResolver
- Enclosing class:
VaadinSavedRequestAwareAuthenticationSuccessHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface VaadinSavedRequestAwareAuthenticationSuccessHandler.SuccessUrlResolver
Resolves the URL to redirect to after a successful authentication, for
example to send users to a landing page that depends on their roles.
The resolved URL takes precedence over both the originally requested URL and the default target URL. It is delivered the same way as those, so it works for form and OAuth2 login as well as for login from a Hilla client.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringresolveSuccessUrl(jakarta.servlet.http.HttpServletRequest request, org.springframework.security.core.Authentication authentication, @Nullable String savedUrl) Resolves the URL to redirect to after a successful authentication.
-
Method Details
-
resolveSuccessUrl
@Nullable String resolveSuccessUrl(jakarta.servlet.http.HttpServletRequest request, org.springframework.security.core.Authentication authentication, @Nullable String savedUrl) Resolves the URL to redirect to after a successful authentication.- Parameters:
request- the request which caused the successful authenticationauthentication- the authentication created during the authentication processsavedUrl- the absolute URL the user tried to access before being asked to log in, ornullif there is none. When the request was intercepted by Spring Security, this is the saved request URL, which may carry Spring Security'scontinuequery parameter (for examplehttp://localhost:8080/admin?continue); when the navigation was intercepted by Vaadin, it is the plain absolute URL. Parse it, for example withURI.getPath(), rather than comparing it to a path directly- Returns:
- the URL to redirect to, or
nullto redirect to the saved URL or the default target URL as if no resolver was set
-