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 Type
    Method
    Description
    @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.
  • 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 authentication
      authentication - the authentication created during the authentication process
      savedUrl - the absolute URL the user tried to access before being asked to log in, or null if there is none. When the request was intercepted by Spring Security, this is the saved request URL, which may carry Spring Security's continue query parameter (for example http://localhost:8080/admin?continue); when the navigation was intercepted by Vaadin, it is the plain absolute URL. Parse it, for example with URI.getPath(), rather than comparing it to a path directly
      Returns:
      the URL to redirect to, or null to redirect to the saved URL or the default target URL as if no resolver was set