Example usage for org.springframework.security.web.authentication UsernamePasswordAuthenticationFilter setUsernameParameter

List of usage examples for org.springframework.security.web.authentication UsernamePasswordAuthenticationFilter setUsernameParameter

Introduction

In this page you can find the example usage for org.springframework.security.web.authentication UsernamePasswordAuthenticationFilter setUsernameParameter.

Prototype

public void setUsernameParameter(String usernameParameter) 

Source Link

Document

Sets the parameter name which will be used to obtain the username from the login request.

Usage

From source file:com.brienwheeler.web.spring.security.AuthenticationFilterConfigurer.java

private void configureFilter(UsernamePasswordAuthenticationFilter filter) {
    filter.setPostOnly(postOnly);/*from w  w w. j  a v  a 2 s.co m*/
    filter.setUsernameParameter(usernameParameter);
    filter.setPasswordParameter(passwordParameter);
}

From source file:com.jappstart.service.auth.UserPassAuthFilterBeanPostProcessor.java

@Override
public final Object postProcessBeforeInitialization(final Object bean, final String beanName) {
    if (bean instanceof UsernamePasswordAuthenticationFilter) {
        final UsernamePasswordAuthenticationFilter filter = (UsernamePasswordAuthenticationFilter) bean;
        filter.setUsernameParameter(getUsernameParameter());
        filter.setPasswordParameter(getPasswordParameter());
    }/*from  www  .j  av a  2s.c om*/

    return bean;
}