[jcifs] silent authentication

Markus Pitsch markus_pitsch at gmx.net
Tue Sep 6 12:44:44 GMT 2005


thanks you,..

i tried out this filter and it works great when a user is logged in,..

i try to discribe what i need for our application:

we have a application running for example on http://localhost:8080/Test.
there is a login, for username and password. i put the filter in the
web.xml:
<!--
	<filter>
    	<filter-name>NtlmHttpFilter</filter-name>
    	<filter-class>jcifs.http.NtlmHttpFilter</filter-class>
		<init-param>
        	<param-name>jcifs.smb.client.domain</param-name>
        	<param-value>ww300</param-value>
    	</init-param>
    	
    	<init-param>
        	<param-name>jcifs.netbios.wins</param-name>
        	<param-value>our wins server</param-value>
    </init-param>
 	
	</filter>

	<filter-mapping>
   		<filter-name>NtlmHttpFilter</filter-name>
   		<url-pattern>/ww300Login</url-pattern>
	</filter-mapping>

<servlet>
        <servlet-name>authServlet</servlet-name>
        <servlet-class>JavaSource.NtlmHttpAuthentication</servlet-class>
    </servlet>

	<servlet-mapping>
        <servlet-name>authServlet</servlet-name>
        <url-pattern>/ww300Login</url-pattern>
    </servlet-mapping>
	-->

then i have a servlet, localhost:8080/ww300Login, to get out the user and
after that i do a redirect to our application. this servlet is placed before
our application:

public class NtlmHttpAuthentication extends HttpServlet {
	
	public void doGet( HttpServletRequest req, HttpServletResponse resp )
throws IOException, ServletException {
		
		HttpSession session;
		
		String user = req.getRemoteUser();
		System.out.println("Beginn ww300Login,....");
		System.out.println("Remote User: " + user);
		
		session = req.getSession();
		session.setAttribute("ww300",user);
		System.out.println("End ww300Login,....");
		resp.sendRedirect("http://atpc3wjc:8080/ePrompt");
		
		
    }

	public void doPost( HttpServletRequest req, HttpServletResponse resp )
throws IOException, ServletException {
		doGet( req, resp );
	}
}
 
when a user is still in the domain ww300 it´s no problem to go to servlet at
localhost:8080/ww300Login. the servlet is working fine and make the
redirect. then we can handle the logged user in our application, look up in
our database if the user is still there, and then will be no need to do the
login.
but when a user, who is not in the domain, goes to localhost:8080/ww300Login
the servlet is not working. it hangs up,... i think thats because the filter
is on the same layer like the servlet, but i don´t no if i'am right and i
have no idee to fix that problem.

i hope you understand my problem and give me a resolution

thanks,..

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner


More information about the jcifs mailing list