Package org.springframework.security.web.authentication.ui

# Class DefaultLoginPageGeneratingFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter

All Implemented Interfaces:
  `jakarta.servlet.Filter`, `org.springframework.beans.factory.Aware`, `org.springframework.beans.factory.BeanNameAware`, `org.springframework.beans.factory.DisposableBean`, `org.springframework.beans.factory.InitializingBean`, `org.springframework.context.EnvironmentAware`, `org.springframework.core.env.EnvironmentCapable`, `org.springframework.web.context.ServletContextAware`

public class DefaultLoginPageGeneratingFilter extends org.springframework.web.filter.GenericFilterBean
For internal use with namespace configuration in the case where a user doesn't configure a login page. The configuration code will insert this filter in the chain instead. Will only work if a redirect is used to the login page.

Since:
  2.0

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DEFAULT_LOGIN_PAGE_URL`
`static final String`
`ERROR_PARAMETER_NAME`

### Fields inherited from class org.springframework.web.filter.GenericFilterBean

`logger`

## Constructor Summary

Constructors
Constructor
Description
`DefaultLoginPageGeneratingFilter()`
`DefaultLoginPageGeneratingFilter(UsernamePasswordAuthenticationFilter authFilter)`

## Method Summary

Modifier and Type
Method
Description
`void`
`doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain)`
`String`
`getLoginPageUrl()`
`boolean`
`isEnabled()`
`void`
`setAuthenticationUrl(String authenticationUrl)`
`void`
`setFailureUrl(String failureUrl)`
`void`
`setFormLoginEnabled(boolean formLoginEnabled)`
`void`
`setLoginPageUrl(String loginPageUrl)`
`void`
`setLogoutSuccessUrl(String logoutSuccessUrl)`
`void`
`setOauth2AuthenticationUrlToClientName(Map<String,String> oauth2AuthenticationUrlToClientName)`
`void`
`setOauth2LoginEnabled(boolean oauth2LoginEnabled)`
`void`
`setOneTimeTokenEnabled(boolean oneTimeTokenEnabled)`
`void`
`setOneTimeTokenGenerationUrl(String generateOneTimeTokenUrl)`
`void`
`setPasskeysEnabled(boolean passkeysEnabled)`
`void`
`setPasswordParameter(String passwordParameter)`
`void`
`setRememberMeParameter(String rememberMeParameter)`
`void`
`setResolveHeaders(Function<jakarta.servlet.http.HttpServletRequest,Map<String,String>> resolveHeaders)`
Sets a Function used to resolve a Map of the HTTP headers where the key is the name of the header and the value is the value of the header.
`void`
`setResolveHiddenInputs(Function<jakarta.servlet.http.HttpServletRequest,Map<String,String>> resolveHiddenInputs)`
Sets a Function used to resolve a Map of the hidden inputs where the key is the name of the input and the value is the value of the input.
`void`
`setSaml2AuthenticationUrlToProviderName(Map<String,String> saml2AuthenticationUrlToProviderName)`
`void`
`setSaml2LoginEnabled(boolean saml2LoginEnabled)`
`void`
`setUsernameParameter(String usernameParameter)`

### Methods inherited from class org.springframework.web.filter.GenericFilterBean

`addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### DEFAULT_LOGIN_PAGE_URL

public static final String DEFAULT_LOGIN_PAGE_URL

See Also:
  - Constant Field Values

### ERROR_PARAMETER_NAME

public static final String ERROR_PARAMETER_NAME

See Also:
  - Constant Field Values

## Constructor Details

### DefaultLoginPageGeneratingFilter

public DefaultLoginPageGeneratingFilter()

### DefaultLoginPageGeneratingFilter

public DefaultLoginPageGeneratingFilter(UsernamePasswordAuthenticationFilter authFilter)

## Method Details

### setResolveHiddenInputs

public void setResolveHiddenInputs(Function<jakarta.servlet.http.HttpServletRequest,Map<String,String>> resolveHiddenInputs)
Sets a Function used to resolve a Map of the hidden inputs where the key is the name of the input and the value is the value of the input. Typically this is used to resolve the CSRF token.

Parameters:
  `resolveHiddenInputs` - the function to resolve the inputs

### setResolveHeaders

public void setResolveHeaders(Function<jakarta.servlet.http.HttpServletRequest,Map<String,String>> resolveHeaders)
Sets a Function used to resolve a Map of the HTTP headers where the key is the name of the header and the value is the value of the header. Typically, this is used to resolve the CSRF token.

Parameters:
  `resolveHeaders` - the function to resolve the headers

### isEnabled

public boolean isEnabled()

### setLogoutSuccessUrl

public void setLogoutSuccessUrl(String logoutSuccessUrl)

### getLoginPageUrl

public String getLoginPageUrl()

### setLoginPageUrl

public void setLoginPageUrl(String loginPageUrl)

### setFailureUrl

public void setFailureUrl(String failureUrl)

### setFormLoginEnabled

public void setFormLoginEnabled(boolean formLoginEnabled)

### setOauth2LoginEnabled

public void setOauth2LoginEnabled(boolean oauth2LoginEnabled)

### setOneTimeTokenEnabled

public void setOneTimeTokenEnabled(boolean oneTimeTokenEnabled)

### setSaml2LoginEnabled

public void setSaml2LoginEnabled(boolean saml2LoginEnabled)

### setPasskeysEnabled

public void setPasskeysEnabled(boolean passkeysEnabled)

### setAuthenticationUrl

public void setAuthenticationUrl(String authenticationUrl)

### setOneTimeTokenGenerationUrl

public void setOneTimeTokenGenerationUrl(String generateOneTimeTokenUrl)

### setUsernameParameter

public void setUsernameParameter(String usernameParameter)

### setPasswordParameter

public void setPasswordParameter(String passwordParameter)

### setRememberMeParameter

public void setRememberMeParameter(String rememberMeParameter)

### setOauth2AuthenticationUrlToClientName

public void setOauth2AuthenticationUrlToClientName(Map<String,String> oauth2AuthenticationUrlToClientName)

### setSaml2AuthenticationUrlToProviderName

public void setSaml2AuthenticationUrlToProviderName(Map<String,String> saml2AuthenticationUrlToProviderName)

### doFilter

public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException

Throws:
  `IOException`
  `jakarta.servlet.ServletException`