Package com.vaadin.flow.spring.security
Class VaadinSavedRequestAwareAuthenticationSuccessHandler
- java.lang.Object
-
- org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
-
- org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
-
- org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
-
- com.vaadin.flow.spring.security.VaadinSavedRequestAwareAuthenticationSuccessHandler
-
- All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationSuccessHandler
public class VaadinSavedRequestAwareAuthenticationSuccessHandler extends org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandlerA version ofSavedRequestAwareAuthenticationSuccessHandlerthat writes a different return value for a Fusion TypeScript client.This class acts as a
SavedRequestAwareAuthenticationSuccessHandlerunless the request from the client contains a "source: typescript" header.If the header is present, it sends a return value that is an "ok" instead of a "redirect" response. This is so that the TypeScript caller is able to read the returned values. Additionally it sends the saved URL separately so the client can decide where to redirect if no URL was saved.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVaadinSavedRequestAwareAuthenticationSuccessHandler.RedirectStrategyRedirect strategy used byVaadinSavedRequestAwareAuthenticationSuccessHandler.
-
Constructor Summary
Constructors Constructor Description VaadinSavedRequestAwareAuthenticationSuccessHandler()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)voidsetRequestCache(org.springframework.security.web.savedrequest.RequestCache requestCache)-
Methods inherited from class org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
clearAuthenticationAttributes
-
Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
determineTargetUrl, determineTargetUrl, getDefaultTargetUrl, getRedirectStrategy, getTargetUrlParameter, handle, isAlwaysUseDefaultTargetUrl, setAlwaysUseDefaultTargetUrl, setDefaultTargetUrl, setRedirectStrategy, setTargetUrlParameter, setUseReferer
-
-
-
-
Method Detail
-
onAuthenticationSuccess
public void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws javax.servlet.ServletException, IOException- Specified by:
onAuthenticationSuccessin interfaceorg.springframework.security.web.authentication.AuthenticationSuccessHandler- Overrides:
onAuthenticationSuccessin classorg.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler- Throws:
javax.servlet.ServletExceptionIOException
-
setRequestCache
public void setRequestCache(org.springframework.security.web.savedrequest.RequestCache requestCache)
- Overrides:
setRequestCachein classorg.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
-
-