Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > suppress login dialog with XMLHttpRequest object & NTLM auth

Reply
Thread Tools

suppress login dialog with XMLHttpRequest object & NTLM auth

 
 
samir.kuthiala@gmail.com
Guest
Posts: n/a
 
      05-12-2006
I do some requests in the background on a page using the XMLHttpRequest
object. My site uses NTLM Authentication. However if the user is not
logged in, it throws up an ugly dialog box. Is there any way to
suppress this? I am ok with the object throwing an error which I can
catch.

What I want to do is to make a request. Instead of it popping up a
dialog box, I want to be able to suppress this dialog and instead
forward him to a separate login page.

Thanks

 
Reply With Quote
 
 
 
 
Bart Van der Donck
Guest
Posts: n/a
 
      05-12-2006
wrote:

> I do some requests in the background on a page using the XMLHttpRequest
> object. My site uses NTLM Authentication. However if the user is not
> logged in, it throws up an ugly dialog box. Is there any way to
> suppress this? I am ok with the object throwing an error which I can
> catch.
>
> What I want to do is to make a request. Instead of it popping up a
> dialog box, I want to be able to suppress this dialog and instead
> forward him to a separate login page.


See

http://jibbering.com/2002/4/httprequest.html

Just request the header in stead of the full page:

xmlhttp.open("HEAD", "/aDir/aPage.htm",true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
alert(xmlhttp.getAllResponseHeaders())
}
}
xmlhttp.send(null)

Then check the returned HTTP numeric status code whether NTLM
Authentication is required or not:

HTTP/1.1 200 OK
[...headers...]

I believe that this status code would be 401.2 when the message should
be negotiated using NTLM authentication.

Then replace your current location to the login page depending on that
status code.

I'm not sure you can use getResponseHeader('headername'); because the
returned status code is actually not a part of the headers.

Hope this helps,

--
Bart

 
Reply With Quote
 
 
 
 
Bart Van der Donck
Guest
Posts: n/a
 
      05-12-2006
Bart Van der Donck wrote:

> wrote:
>
> > I do some requests in the background on a page using the XMLHttpRequest
> > object. My site uses NTLM Authentication. However if the user is not
> > logged in, it throws up an ugly dialog box. Is there any way to
> > suppress this? I am ok with the object throwing an error which I can
> > catch.
> >
> > What I want to do is to make a request. Instead of it popping up a
> > dialog box, I want to be able to suppress this dialog and instead
> > forward him to a separate login page.

>
> See
>
> http://jibbering.com/2002/4/httprequest.html
>
> Just request the header in stead of the full page:
>
> xmlhttp.open("HEAD", "/aDir/aPage.htm",true);
> xmlhttp.onreadystatechange=function() {
> if (xmlhttp.readyState==4) {
> alert(xmlhttp.getAllResponseHeaders())
> }
> }
> xmlhttp.send(null)
>
> Then check the returned HTTP numeric status code whether NTLM
> Authentication is required or not:


On second thought, the header request would perhaps also require this
NTLM authentication (thus still showing the authentication box). I'm
not sure it is possible to use XMLHttpRequest so that it only returns
the HTTP status code and nothing else.

--
Bart

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Web.Mail.MailMessage - Conversation Type and NTLM auth Raj ASP .Net 0 06-02-2009 02:38 AM
ANN: python-ntlm - provides NTLM support, including an authenticationhandler for urllib2 Matthijs Python 0 12-10-2008 03:38 PM
Forcing Reauthentication for a Webform with NTLM auth..ion Andrew_Revinsky ASP .Net Security 3 07-14-2004 09:22 AM
Configuring Windows Auth & Forms Auth in Asp.Net =?Utf-8?B?Q2hyaXMgTW9oYW4=?= ASP .Net 0 04-28-2004 06:11 PM
Suppress login dialog when impersonation on? Gary H. ASP .Net Security 1 07-17-2003 12:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57