public class CommunoteAuthenticationSuccessHandler
extends org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
Constructor and Description |
---|
CommunoteAuthenticationSuccessHandler() |
Modifier and Type | Method and Description |
---|---|
String |
addRedirectionTarget(String urlToInclude,
boolean strict)
Add a URL which can be used as redirection target after successful authentication.
|
protected String |
determineTargetUrl(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Get the targetUrl from the request parameter returned by
AbstractAuthenticationTargetUrlRequestHandler.getTargetUrlParameter() . |
protected void |
handle(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.security.core.Authentication authentication) |
boolean |
removeRedirectionTarget(String url)
Remove a URL which was previously added with
addRedirectionTarget(String, boolean)
or setRedirectionTargets(List) |
void |
setRedirectionTargets(List<String> urlsToInclude)
Set the URLs which can be used as redirection target after successful authentication.
|
void |
setRequestCache(org.springframework.security.web.savedrequest.RequestCache requestCache)
Set a request cache to look for a redirection target if no target URL was provided by a
request parameter.
|
clearAuthenticationAttributes, onAuthenticationSuccess
getDefaultTargetUrl, getRedirectStrategy, getTargetUrlParameter, isAlwaysUseDefaultTargetUrl, setAlwaysUseDefaultTargetUrl, setDefaultTargetUrl, setRedirectStrategy, setTargetUrlParameter, setUseReferer
public CommunoteAuthenticationSuccessHandler()
public String addRedirectionTarget(String urlToInclude, boolean strict)
AbstractAuthenticationTargetUrlRequestHandler.getTargetUrlParameter()
or a cashed request. The found redirection target will only be used if it starts with one of
the URLs added via this or the setRedirectionTargets(List)
method.urlToInclude
- the URL to includestrict
- true to take the URL as is, if false the URL will be trimmed and a "/" will be
prepended if missingprotected String determineTargetUrl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Get the targetUrl from the request parameter returned by AbstractAuthenticationTargetUrlRequestHandler.getTargetUrlParameter()
.
The referer or the default URL are not considered.
determineTargetUrl
in class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
request
- the current requestresponse
- the current responseprotected void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication) throws IOException, javax.servlet.ServletException
handle
in class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler
IOException
javax.servlet.ServletException
public boolean removeRedirectionTarget(String url)
addRedirectionTarget(String, boolean)
or setRedirectionTargets(List)
url
- the URL to removepublic void setRedirectionTargets(List<String> urlsToInclude)
AbstractAuthenticationTargetUrlRequestHandler.getTargetUrlParameter()
or a cashed request. The found redirection target will only
be used if it starts with one of the URLs added via this or the
addRedirectionTarget(String, boolean)
method.urlsToInclude
- the URLs to includepublic void setRequestCache(org.springframework.security.web.savedrequest.RequestCache requestCache)
HttpSessionRequestCache
will be used.requestCache
- the cache to useCopyright © 2019 Communote team. All rights reserved.