File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JForum and the fly likes Ntlm authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Ntlm authentication" Watch "Ntlm authentication" New topic

Ntlm authentication

Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I have been using this good software from 1 month. I am trying to integrate this with some other web apps done in j2ee. In our, intranet we are using ntlm authentication for all web apps. Problem is I have to authenticate 2 times, one for my application and one for jforum. I want to have only 1 ntlm authentication. How can I use NTLM in jforum?.

Thank you
durga prasad
[originally posted on by Anonymous]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Take a look here:

I don't have any experiencie with NTLM, though. However, you are very welcome to share with us your process, and maybe even document it in the Wiki, to have it registered for future users

[originally posted on by Rafael Steil]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi Rafael,
Actually I dont need NTLM authentication [My Boss told me later]. What I have to do is authenticate it with our corporate accounts.

I have done it myself. I have used jcifs and could do the authentication, if that user is not there in our JForum, I am creating a user on the fly and letting him proceed further.

I am willing to share that part of code [maybe others will be benifited].

I am attaching those files.

1) I have added in src\net\jforum\drivers\external
2) I have modified configuration to use this authenticator
3) I used jcifs.jar
[originally posted on by Anonymous]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424

I have tried to click attach files button.. but I am not getting upload dialog.

So, I will paste the code of here..

package net.jforum.drivers.external;

once after you have put above code in src\net\jforum\drivers\external
"login.authenticator = net.jforum.drivers.external.DefaultLoginAuthenticator" with
"login.authenticator = net.jforum.drivers.external.NTLMLoginAuthenticator"

you can download jcifs.jar from net.

Thank you
Durga Prasad
[originally posted on by durgaprasad_j]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Has anyone updated this code for the latest version?

Has anyone implemented NTLM authentication into the most recent stuff? Are there any guidelines I can read on it? I would greatly appreciate it..

My scenario is that I need to provide internal users with a forum for the application I develop for my employer.

The key is, I need to get the users from the Windows domain...
Ideally--anyone w/ a valid NT credentials would be allowed in as a general user ... but if there has to be an intermediate step for user creation, I can work with that as well.


[originally posted on by xiarcel]
Migrated From
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Using SSO and NTLM:

After a long time of trying, i got it. It's pretty easy and i want to show it to you, so everyone, who wants to implement NTLM and SSO in JForum, does not have to spend so much time like i did...

At first you have to install your JForum. Then you only have to change two things:

1. in the (../webapps/YOUR_FORUM_NAME/WEB-INF/config/ ):

in line 329 activate Single Sign-On:
authentication.type = sso

2. in the web.xml (../webapps/YOUR_FORUM_NAME/WEB-INF/ ):

put the NTLM-Filter before the first <servlet> - tag. The NTLM-filter looks like this:

� YOURDOMAINNAME = NTLM domain name (for example the name of your company)
� = IP-Adresse des WINS Servers
(ipconfig/all -> findet alle IP-Adressen des WINS Servers)

At last, DO NOT FORGET to put the JCIFS.jar into the library (../webapps/YOUR_FORUM_NAME/WEB-INF/lib/ ).
The JCIFS is necessary for the NTLM Authentication. Please note: you have to use this Version: jcifs-1.2.25.jar
The newer versions throw exceptions in jforum, because they try to use NTLMv2, but in jforum runs only NTLMv1.

Here you get JCIFS:

That's it. Please note: you don't need the NTLMLoginAuthenticator if you use the sso.

Enjoy it..

[originally posted on by david]
I agree. Here's the link:
subject: Ntlm authentication
jQuery in Action, 3rd edition