waffle icon indicating copy to clipboard operation
waffle copied to clipboard

Mixed auth: Strange 404 errors when using dns alias - Fix included

Open micky0867 opened this issue 6 years ago • 2 comments

Hi,

I had some strange errors on a server with several dns alias names like: srvx.sub.c srvy.sub.c srvy.sub.sub.c srvz.sub.c The primary name is srvx.sub.sub.c

Versions: Tomcat Version : Apache Tomcat/7.0.50 Servlet Specification Version : 3.0 JSP version : 2.2

The problem occured when I tried to login thru the login-form using the primary name or an particular alias name. Other alias names didn't have that problem. Regardless of the authentication method, when the form submitted the POST request to index.jsp?, I got an 404 error. Simply retransmitting the request by pressing Enter in the browsers adressbar, logged me in successfuly.

FIX: I changed the loginform to include the hidden fields "j_negotiate_check" and "j_security_check", so they get POSTED, instead of mixing POST and GET by using "index.jsp?" in the loginform like described in the docs. Now everything works like a charme.

BTW: thank you for his great piece of software

cheers Micky

<form method="POST" name="loginform" action="/myapp/index.jsp"> <input type="submit" value="Mit Windows Credentials anmelden" /> <input type="hidden" name="j_negotiate_check" value="1"> </form> <br> <form method="POST" name="loginform" action="/myapp/index.jsp"> <table style="vertical-align: middle;"> <tr> <td>Username:</td> <td><input type="text" name="j_username" /></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="j_password" /></td> </tr> <tr> <td><input type="submit" value="Login" /></td> </tr> </table> <input type="hidden" name="j_security_check" value="1"> </form>

micky0867 avatar Oct 22 '19 08:10 micky0867

Nice. Can you please PR the actual fix? See https://github.com/Waffle/waffle#contributing

dblock avatar Oct 22 '19 13:10 dblock

@micky0867 Can you write a PR for your fixes?

hazendaz avatar Jan 09 '20 04:01 hazendaz