java - Get j_username before having authentication completed -
i constructed filter runs before "springsecurityfilterchain" , filter needs j_username dofilter method. unfortuntaly it's impossible use principal object , username throught getname() before end of successful authentication.
there other way j_username in first filter?
override
public class exusernamepasswordauthenticationfilter extends usernamepasswordauthenticationfilter { @override public authentication attemptauthentication(httpservletrequest request, httpservletresponse response) throws authenticationexception { final string username = request.getparameter("j_username"); // delegate logic return super.attemptauthentication(request, response); } }
in security config < http />
<bean id="exusernamepasswordauthfilter" class="..." /> <custom-filter ref="exusernamepasswordauthfilter" position="form_login_filter"/>
Comments
Post a Comment