[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6543
  • Last Modified:

NTLM Authentication in Tomcat Server

Hi,

 I've hosted my application in Tomcat.
I'm using NTLM Authentication.
The problem which I'm facing now is the server is not accepting POST requests.
Please help me in solving the problem.

Thanks in advance !!!
0
sujithkumars123
Asked:
sujithkumars123
  • 4
  • 4
1 Solution
 
rk_radhakrishnaCommented:
sujithkumars123,

using JCIFS we can do it.
This information may be usefull for developers like me ,

it is very simple 2 steps

1. download jcifs version xx.jar from the following link and install(copy) the jar into classpath of the IDE (server)

2 modify the web.xml with the following code, remember to put the code next to <display-name> entry
<filter>
<filter-name>NtlmHttpFilter</filter-name>
<filter-class>jcifs.http.NtlmHttpFilter</filter-class>
<init-param>
<param-name>jcifs.http.domainController</param-name>
<param-value>your IP address</param-value>
</init-param>
</filter>

In servlet or Action class use the following line to get the ID
request.getRemoteUser()

I have taken this message from this link so, it hope it may helps you
http://forum.java.sun.com/thread.jspa?forumID=45&messageID=2637226&threadID=503849
0
 
sujithkumars123Author Commented:
I tried this solution, but still the error is coming. I found that the browser is sending a no of headers. is there any way to remove these headers?
0
 
rk_radhakrishnaCommented:
I got the same problem when i was working with other problem, I removed header tag then I solved that.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
rk_radhakrishnaCommented:
try it..
header('WWW-Authenticate: Negotiate');
header('WWW-Authenticate: NTLM', false);
0
 
sujithkumars123Author Commented:
Can u post the code used for removing the header tags, i tried setting authorization headerto "" but it is still keeping that same old value.

Thanks,
Sujith
0
 
rk_radhakrishnaCommented:
0
 
sujithkumars123Author Commented:
We had implemeted the same solution; then we switched over to jcifs filter;
We never found a solution for post parameters getting null;
Always the browser is setting Authentication header which causes the problem; we tried resetting headers which did not even work;
0
 
sujithkumars123Author Commented:
Solved the problem.
We loaded a JSP page, which is in a different directory, in a new window and did the authentication.
Then we closed the window.
Thanks for the support rk_radhakrishna.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now