java - Spring security really strange behaviour in IE -


i'm having weirdest problem have ever seen before.

the application working on uses spring security 3.1.3 provide authentication support. there custom login form have implemented custom authenticationmanager / successhandler , failurehandler.

for reason on internet explorer error message "please fill in mandatory fields". caused appending /login?error=1 end of url can accessed through following code (the redirectandadderror method):

public class tideusernamepasswordauthenticationfilter extends usernamepasswordauthenticationfilter {  public tideusernamepasswordauthenticationfilter() {     super(); }  @override public authentication attemptauthentication(httpservletrequest request, httpservletresponse response) {      string username = request.getparameter(spring_security_form_username_key);     string password = request.getparameter(spring_security_form_password_key);      if (stringutils.isblank(username) || stringutils.isblank(password)) {         redirectandadderror(response);         return null;     }      return super.attemptauthentication(request, response); }  private void redirectandadderror(httpservletresponse response) {     try {         response.sendredirect("/tide/login?error=1");     } catch (ioexception e) {         throw new authenticationserviceexception(e.getmessage(), e);     } } 

so tried using fiddler2, web debugging proxy view if 1 of 2 parameters empty. strange thing when program running error not occur anymore , can log on successfully.

had had similar problem before? think it's not related code running tool "solves" problem.

this problem occurs in internet explorer makes more strange.

edit

i have used tool watch requests , happens in ie:

first post request sent uri /authenticate, have set myself this:

<beans:property name="filterprocessesurl" value="/authenticate"/> 

the response of request has http status code 302, moved temporarily , returns new location @ /login?error=1 (my form mandatory fields required error).

after request occurs /login?error=1 status code 401: unauthorized. intercept-url set this:

 <intercept-url pattern="/login**" access="permitall"/> 

the next request request /login?error=1 again, time status code showing: error_internet_connection_reset, looks problem.

in google chrome following request made:

post /authenticate, result 302: moved temporarily dashboard page (which display after logging on)

someone on team figured out problem after finding issue in chromium bugtracker:

https://code.google.com/p/chromium/issues/detail?id=62687

the problem has been resolved adding in our login controller

@requestmapping(value = "/login", method = requestmethod.post) public string dologin() throws servletexception, ioexception {     return "forward:/authenticate"; } 

and changing url form posts to 1 instead of authentication url spring security provides (we redirecting manually now)


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -