Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

nabajyoti bhattacharjee

Greenhorn
+ Follow
since Jan 19, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by nabajyoti bhattacharjee

Any luck on this.........
12 years ago
JSP
The crux of the matter is:

I want to authenticate the users across browsers, across domains.

ie find out the name and domain name

What are the possible ways?
12 years ago
JSP
Hi Jeanne,

initialy i am using a custom filter.

the code is

now, this gives the login name and domain name for all browsers except mac.

So i thought of adding a code which will specifically execute in case it is called from any browser(safari or IE) in a mac.

so i thought of using request.getRemoteUser() but to my misery it was giving null.

when i tried it without custom filter and used a standard ntlmHttpFilter in the DD, it simply worked but as you know. In the filter you need to specify the domain controller.
Now, if the machines from different domains try to access the code, it will not work. However the above code with custom filter works fine for all domains.

So, in order to balance between the two, i though of adding request.getRemoteUser() to the above code which will be executed when the browser is safari or IE for mac.

So, i used String str = request.getHeader("user-agent");
//"Macintosh"
if(str.indexOf("Macintosh") > -1)

and chip in

request.getRemoteUser();


I hope this will present you the issue nicely....thanks

[edited to add code tags]
[ April 24, 2008: Message edited by: Jeanne Boyarsky ]
12 years ago
JSP
i have a custom filter in web.xml ...where i have metioned the name of the java class which will be doing the filtering part.

now when i use request.getRemoteUser()
it gives null.

what is the propwer code for obtaining request.getRemoteUser()?
Do I need to import any package for performing the operation?


can you please send me the code for doing the same?
12 years ago
JSP
request.getHeader("Authorization");
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NTLM");
to obtain information and used a method sun.misc.BASE64Decoder().decodeBuffer()
The code worked fine for most of the browsers for mac safari it went into a loop and was giving null. Also we had implemented the code using a custom filter class.
When the code crashed for safari, i tried to change the code and implemented request.getRemoteUser() using NtlmHttpFilter and it worked fine for safari. But we had another requirement to make it domain compatible. When accessed from a different domain the code requst.getRemoteUser() does not seem to work as inside the ntlmHttpFilter one needs to mention the ip of the domain controller. now, iw as thinking if we cold write the same code in the custom java class filter which we initially built. now for doing that, dependind on the browser type i will choose the code.
However the code request.getRemoteUser() does not seem to work as it is showing null in the result.

can you please find out a way out?


Thanks for the reply.....
12 years ago
JSP
I have been using request.getRemoteUser() to find out the login name and domain name. But it used a filter NtlmHttp Flter for filtering. Can we use the same request.getRemoteUser() using Custom Servlet so we do not need to define the Filter.
12 years ago
JSP
Hi

I have been working in an application which is an intranet application which has been extended for domain compatibility as well as browser compliance.

Now some of the codes are not working in either of the two.

For browser compliance the code 64decoder is not working....
when changed to ntlm rewuest.getRemoteUser(), it wors fine in safari.
Then it will not work in a different domain.

I am using a custom filter for domain compliance.

But to address the mac safari issue, i have used the ntlmHttpFilter for the request.getRemoteUser() to work correctly.

But then we cannot have two flters in the web.xml file.

Now i want to know if we could write the custom filter in such a way that it uses the request.getRemoteUser() wiwthout looking for the ntlmHttpFilter.
Because if we do that, we cannot make compliant for both the issues.

I was thinking if the ntlmHttpFilter class could be used in the custom filter class without using the filter.

I would really appreciateit if anyone could come up witha solution.

THankss... :-)
12 years ago