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

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

Introduction

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

Prototype

public void setPasswordParameter(String passwordParameter) 

Source Link

Document

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

Usage

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

private void configureFilter(UsernamePasswordAuthenticationFilter filter) {
    filter.setPostOnly(postOnly);/* w ww .j  a  v  a2  s.  c  om*/
    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());
    }//  w w w  . j av a  2s.c o  m

    return bean;
}