[jcifs] RE:

Duseja, Sushil sushil.duseja at fiserv.com
Thu Nov 27 09:53:32 GMT 2008


Thank you for the response.

 

It worked fine; can you please let me know how can I fetch user's
"e-mail" once authenticated?

 

Thanks again.

 

-----Original Message-----
From: Yannick Lavanant [mailto:yannick at smellyfrog.com] 
Sent: Thursday, November 27, 2008 2:34 PM
To: Duseja, Sushil
Cc: jcifs at lists.samba.org; Rally, Menka
Subject: 

 

 

 

You need to use pre-authentication. What we did is to create a user in
our

domain with minimum rights granted. Our admin were a bit reticent at
first, but

eventually aggreed on only changing the password once or twice a year.

In the meantime, you can try this by putting your own credentials, but
be

careful as your password will be in the clear in the web.xml file.

Check out the following page:

http://jcifs.samba.org/src/docs/ntlmhttpauth.html

 

The bit that interests you is the following:

 

    <init-param>

        <param-name>jcifs.smb.client.username</param-name>

        <param-value>somenycuser</param-value>

    </init-param>

    <init-param>

        <param-name>jcifs.smb.client.password</param-name>

        <param-value>AReallyLoooongRandomPassword</param-value>

    </init-param>

 

Regards

Yannick

 

Duseja, Sushil wrote:

> 

> Hello,

> 

> 

> 

> I am new to jCIFS and willing to know as to how I can use windows

authentication using jCIFS.

> 

> 

> 

> I ran through the link -
http://jcifs.samba.org/src/docs/ntlmhttpauth.html and

developed a small web application (deployed on tomcat 5.x) which would
fetch

user details for me from my organization's active directory. It works
fine on

my machine; however when I try running the application from any other
machine,

it prompts me for the credentials. I want this application to
authenticate the

user (without user having to key in the credentials) that is logged on
to the

machine and fetch his/her user details. Can anyone please advise?

> 

> 

> 

> Here's my web.xml

> 

> 

> 

> <?xml version="1.0" encoding="UTF-8"?>

> 

> <web-app id="WebApp_ID" version="2.4"

> 

>       xmlns="http://java.sun.com/xml/ns/j2ee"

> 

>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

> 

>       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee

http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

> 

> 

> 

>       <display-name>AD Authentication</display-name>

> 

> 

> 

> 

> 

>       <filter>

> 

>             <filter-name>NtlmHttpFilter</filter-name>

> 

>             <filter-class>jcifs.http.NtlmHttpFilter</filter-class>

> 

> 

> 

> 

> 

>             <init-param>

> 

>                   <param-name>jcifs.http.domainController</param-name>

> 

>                   <param-value>Active Directory</param-value>

> 

>                   </init-param>

> 

> 

> 

>             <init-param>

> 

>                   <param-name>jcifs.smb.client.domain</param-name>

> 

>                   <param-value>MYDOMAIN</param-value>

> 

>             </init-param>

> 

> 

> 

>       </filter>

> 

> 

> 

>       <filter-mapping>

> 

>             <filter-name>NtlmHttpFilter</filter-name>

> 

>             <url-pattern>/*</url-pattern>

> 

>       </filter-mapping>

> 

> 

> 

>       <welcome-file-list>

> 

>             <welcome-file>index.jsp</welcome-file>

> 

>       </welcome-file-list>

> 

> 

> 

> </web-app>

> 

> 

> 

> 

> 

> Thanking you in anticipation.

 

 

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the jcifs mailing list