Java Code Examples for org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#setFormLoginEnabled()

The following examples show how to use org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#setFormLoginEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomFormLoginConfig.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
/**
 * If available, initializes the {@link DefaultLoginPageGeneratingFilter} shared object.
 *
 * @param http the {@link HttpSecurityBuilder} to use
 */
private void initDefaultLoginFilter(H http) {
    DefaultLoginPageGeneratingFilter loginPageGeneratingFilter = http.getSharedObject(DefaultLoginPageGeneratingFilter.class);
    if(loginPageGeneratingFilter != null && !isCustomLoginPage()) {
        loginPageGeneratingFilter.setFormLoginEnabled(true);
        loginPageGeneratingFilter.setUsernameParameter(getAuthenticationFilter().getUsernameParameter());
        loginPageGeneratingFilter.setPasswordParameter(getAuthenticationFilter().getPasswordParameter());
        loginPageGeneratingFilter.setLoginPageUrl(getLoginPage());
        loginPageGeneratingFilter.setFailureUrl(getFailureUrl());
        loginPageGeneratingFilter.setAuthenticationUrl(getLoginProcessingUrl());
    }
}
 
Example 2
Source File: CustomFormLoginConfig.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
/**
 * If available, initializes the {@link DefaultLoginPageGeneratingFilter} shared object.
 *
 * @param http
 *            the {@link HttpSecurityBuilder} to use
 */
private void initDefaultLoginFilter(H http) {
    DefaultLoginPageGeneratingFilter loginPageGeneratingFilter = http.getSharedObject(DefaultLoginPageGeneratingFilter.class);
    if (loginPageGeneratingFilter != null && !isCustomLoginPage()) {
        loginPageGeneratingFilter.setFormLoginEnabled(true);
        loginPageGeneratingFilter.setUsernameParameter(getAuthenticationFilter().getUsernameParameter());
        loginPageGeneratingFilter.setPasswordParameter(getAuthenticationFilter().getPasswordParameter());
        loginPageGeneratingFilter.setLoginPageUrl(getLoginPage());
        loginPageGeneratingFilter.setFailureUrl(getFailureUrl());
        loginPageGeneratingFilter.setAuthenticationUrl(getLoginProcessingUrl());
    }
}