org.thymeleaf.testing.templateengine.context.web
Class SpringSecurityWebProcessingContextBuilder
Object
org.thymeleaf.testing.templateengine.context.web.WebProcessingContextBuilder
org.thymeleaf.testing.templateengine.context.web.SpringWebProcessingContextBuilder
org.thymeleaf.testing.templateengine.context.web.SpringSecurityWebProcessingContextBuilder
- All Implemented Interfaces:
- IProcessingContextBuilder
public class SpringSecurityWebProcessingContextBuilder
- extends SpringWebProcessingContextBuilder
|
Method Summary |
protected org.springframework.security.core.Authentication |
getAuthentication(org.springframework.context.ApplicationContext applicationContext,
ITest test,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext,
Locale locale,
Map<String,Object> variables)
Computes and returns a Spring Security Authentication object to be used
for authenticating the desired user for testing purposes. |
String |
getAuthenticationManagerBeanName()
|
protected void |
initSpring(org.springframework.context.ApplicationContext applicationContext,
ITest test,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext,
Locale locale,
Map<String,Object> variables)
|
void |
setAuthenticationManagerBeanName(String authenticationManagerBeanName)
|
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_AUTHENTICATION_MANAGER_BEAN_NAME
public static final String DEFAULT_AUTHENTICATION_MANAGER_BEAN_NAME
- See Also:
- Constant Field Values
DEFAULT_USERNAME_VARIABLE_NAME
public static final String DEFAULT_USERNAME_VARIABLE_NAME
- See Also:
- Constant Field Values
DEFAULT_PASSWORD_VARIABLE_NAME
public static final String DEFAULT_PASSWORD_VARIABLE_NAME
- See Also:
- Constant Field Values
SpringSecurityWebProcessingContextBuilder
public SpringSecurityWebProcessingContextBuilder()
getAuthenticationManagerBeanName
public String getAuthenticationManagerBeanName()
setAuthenticationManagerBeanName
public void setAuthenticationManagerBeanName(String authenticationManagerBeanName)
initSpring
protected final void initSpring(org.springframework.context.ApplicationContext applicationContext,
ITest test,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext,
Locale locale,
Map<String,Object> variables)
- Overrides:
initSpring in class SpringWebProcessingContextBuilder
getAuthentication
protected org.springframework.security.core.Authentication getAuthentication(org.springframework.context.ApplicationContext applicationContext,
ITest test,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext,
Locale locale,
Map<String,Object> variables)
Computes and returns a Spring Security Authentication object to be used
for authenticating the desired user for testing purposes.
By default, an UsernamePasswordAuthenticationToken object is returned,
built with the values of two context variables:
- j_username for the user name.
- j_password for the user password.
If one or both of these variables are not present, null is returned and therefore
no user will be considered to be authenticated.
- Parameters:
applicationContext - the application context, already initializedtest - the ITest objectrequest - the HTTP request objectresponse - the HTTP response objectservletContext - the ServletContext objectlocale - the locale being used for this testvariables - the context variables
- Returns:
- the Authentication object, null if no user is to be considered authenticated.
Copyright © 2013 The THYMELEAF team. All Rights Reserved.