Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
micky0867 opened this issue Oct 22, 2019 · 2 comments
Open
Labels

Comments

@micky0867
Copy link

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>

@dblock
Copy link
Collaborator

dblock commented Oct 22, 2019

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

@dblock dblock added the bug? label Oct 22, 2019
@hazendaz
Copy link
Member

hazendaz commented Jan 9, 2020

@micky0867 Can you write a PR for your fixes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants