|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint
public class LoginUrlAuthenticationEntryPoint
Used by the ExceptionTranslationFilter
to commence a form login
authentication via the UsernamePasswordAuthenticationFilter
. This object
holds the location of the login form, relative to the web app context path,
and is used to commence a redirect to that form.
By setting the forceHttps property to true, you may configure the
class to force the protocol used for the login form to be HTTPS
,
even if the original intercepted request for a resource used the
HTTP
protocol. When this happens, after a successful login
(via HTTPS), the original resource will still be accessed as HTTP, via the
original request URL. For the forced HTTPS feature to work, the PortMapper
is consulted to determine the HTTP:HTTPS pairs.
Constructor Summary | |
---|---|
LoginUrlAuthenticationEntryPoint()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
protected String |
buildHttpsRedirectUrlForRequest(HttpServletRequest request)
Builds a URL to redirect the supplied request to HTTPS. |
protected String |
buildRedirectUrlToLoginPage(HttpServletRequest request,
HttpServletResponse response,
AuthenticationException authException)
|
void |
commence(HttpServletRequest request,
HttpServletResponse response,
AuthenticationException authException)
Performs the redirect (or forward) to the login form URL. |
protected String |
determineUrlToUseForThisRequest(HttpServletRequest request,
HttpServletResponse response,
AuthenticationException exception)
Allows subclasses to modify the login form URL that should be applicable for a given request. |
String |
getLoginFormUrl()
|
protected PortMapper |
getPortMapper()
|
protected PortResolver |
getPortResolver()
|
protected boolean |
isForceHttps()
|
protected boolean |
isUseForward()
|
void |
setForceHttps(boolean forceHttps)
Set to true to force login form access to be via https. |
void |
setLoginFormUrl(String loginFormUrl)
The URL where the UsernamePasswordAuthenticationFilter login
page can be found. |
void |
setPortMapper(PortMapper portMapper)
|
void |
setPortResolver(PortResolver portResolver)
|
void |
setUseForward(boolean useForward)
Tells if we are to do a forward to the loginFormUrl using the RequestDispatcher,
instead of a 302 redirect. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoginUrlAuthenticationEntryPoint()
Method Detail |
---|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
protected String determineUrlToUseForThisRequest(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception)
request
- the requestresponse
- the responseexception
- the exception
getLoginFormUrl()
)public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException
commence
in interface AuthenticationEntryPoint
request
- that resulted in an AuthenticationException
response
- so that the user agent can begin authenticationauthException
- that caused the invocation
IOException
ServletException
protected String buildRedirectUrlToLoginPage(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException)
protected String buildHttpsRedirectUrlForRequest(HttpServletRequest request) throws IOException, ServletException
IOException
ServletException
public void setForceHttps(boolean forceHttps)
https
, then the client will first be redirected to an https URL, even if serverSideRedirect
is set to true.
protected boolean isForceHttps()
public void setLoginFormUrl(String loginFormUrl)
UsernamePasswordAuthenticationFilter
login
page can be found. Should be relative to the web-app context path, and
include a leading /
public String getLoginFormUrl()
public void setPortMapper(PortMapper portMapper)
protected PortMapper getPortMapper()
public void setPortResolver(PortResolver portResolver)
protected PortResolver getPortResolver()
public void setUseForward(boolean useForward)
loginFormUrl
using the RequestDispatcher,
instead of a 302 redirect.
useForward
- protected boolean isUseForward()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |