Request.getRemoteUser() - Mozilla and IE differs

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Request.getRemoteUser() - Mozilla and IE differs

Göran Karlsson (KA/EAB)
Request.getRemoteUser() - Mozilla and IE differs

Hello!

Update: I got the Ntlmfilter working on Tomcat now. I had other filters at the same time, and I inserted the Ntlmfilter in the wrong place. I put it last instead of first.

Now I have another problem. When I get the client user ID in a servlet with request.getRemoteUser() IE will give me domain\userid while Mozilla Firefox will give me only the userid. The domain should be the same for all the users in this case, so I could work around this by checking if the domain is there and in that case cut it off, or append it if it's not there. But the problem is that a lot of existing code is using getRemoteUser, and I can't go around and handle this everywhere.

So how do I get the user id in the same way from both browsers? Surely somebody else here has had the same problem?

My filter configuration is as follows:

  <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>EEMEA</param-value>
    </init-param>
    <init-param>
      <param-name>jcifs.netbios.wins</param-name>
      <param-value>153.88.193.201,147.214.112.67</param-value>
    </init-param>
  </filter>

Any ideas are greatly appreciated.

/Göran

Reply | Threaded
Open this post in threaded view
|

RE: Request.getRemoteUser() - Mozilla and IE differs

Ghouse, Sherjeel
Message
I had a similar situation where Application was accessed using different browsers and over VPN (trusted domains).  Since my application is Servlet based. I was able to trim the domain name(Intranet, VPN, IE) or no domain (in case of FireFox) by overriding get() of the HttpServlet. You could use StrinkTokenizer or whatever logic to figure out if domain name comes in getRemoteUser() or not. You could then store the UserName in HttpSession to be used all over your application.
 
Hope that helps.
 
-Sherjeel
-----Original Message-----
From: jcifs-bounces+sghouse=[hidden email] [mailto:jcifs-bounces+sghouse=[hidden email]] On Behalf Of Göran Karlsson (KA/EAB)
Sent: Thursday, July 06, 2006 8:38 AM
To: [hidden email]
Subject: [jcifs] Request.getRemoteUser() - Mozilla and IE differs

Hello!

Update: I got the Ntlmfilter working on Tomcat now. I had other filters at the same time, and I inserted the Ntlmfilter in the wrong place. I put it last instead of first.

Now I have another problem. When I get the client user ID in a servlet with request.getRemoteUser() IE will give me domain\userid while Mozilla Firefox will give me only the userid. The domain should be the same for all the users in this case, so I could work around this by checking if the domain is there and in that case cut it off, or append it if it's not there. But the problem is that a lot of existing code is using getRemoteUser, and I can't go around and handle this everywhere.

So how do I get the user id in the same way from both browsers? Surely somebody else here has had the same problem?

My filter configuration is as follows:

  <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>EEMEA</param-value>
    </init-param>
    <init-param>
      <param-name>jcifs.netbios.wins</param-name>
      <param-value>153.88.193.201,147.214.112.67</param-value>
    </init-param>
  </filter>

Any ideas are greatly appreciated.

/Göran


CONFIDENTIALITY NOTICE: This message (including any attachments) may contain Molex confidential information, protected by law. If this message is confidential, forwarding it to individuals, other than those with a need to know, without the permission of the sender, is prohibited.

This message is also intended for a specific individual. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message or taking of any action based upon it, is strictly prohibited.

Chinese Japanese

www.molex.com/confidentiality.html
Reply | Threaded
Open this post in threaded view
|

RE: Request.getRemoteUser() - Mozilla and IE differs

Göran Karlsson (KA/EAB)
In reply to this post by Göran Karlsson (KA/EAB)
Message
Thanks!
We ended up hacking into jCIFS and removed the domain there... not a very nice solution, but I hope there are no undiscovered side-effects. :-/
 
/Göran


From: jcifs-bounces+goran.karlsson=[hidden email] [mailto:jcifs-bounces+goran.karlsson=[hidden email]] On Behalf Of Ghouse, Sherjeel
Sent: den 6 juli 2006 15:47
To: [hidden email]
Subject: RE: [jcifs] Request.getRemoteUser() - Mozilla and IE differs

I had a similar situation where Application was accessed using different browsers and over VPN (trusted domains).  Since my application is Servlet based. I was able to trim the domain name(Intranet, VPN, IE) or no domain (in case of FireFox) by overriding get() of the HttpServlet. You could use StrinkTokenizer or whatever logic to figure out if domain name comes in getRemoteUser() or not. You could then store the UserName in HttpSession to be used all over your application.
 
Hope that helps.
 
-Sherjeel
-----Original Message----- 
----8<----- 

Now I have another problem. When I get the client user ID in a servlet with request.getRemoteUser() IE will give me domain\userid while Mozilla Firefox will give me only the userid. The domain should be the same for all the users in this case, so I could work around this by checking if the domain is there and in that case cut it off, or append it if it's not there. But the problem is that a lot of existing code is using getRemoteUser, and I can't go around and handle this everywhere.

So how do I get the user id in the same way from both browsers? Surely somebody else here has had the same problem?  

----->8-----