473,416 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

suppress login dialog with XMLHttpRequest object & NTLM auth

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

May 12 '06 #1
2 10726
sa************@gmail.com 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

May 12 '06 #2
Bart Van der Donck wrote:
sa************@gmail.com 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

May 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
3
by: ~~~ .NET Ed ~~~ | last post by:
This is a strange problem and I wonder if anybody has experienced this annoying anomaly. I created a new ASP.NET project with its web-shared directory on my WinXP Pro/IIS machine. I compile the...
2
by: Nevyn Twyll | last post by:
I'm using VS 2005 to develop a web app, which is cool. For some reason, the internal web server makes me log in using my windows login every time I run it. It's really annoying. Even if I tell...
12
by: Michael | last post by:
Please Help me. I've got a .Net 2003 program that attaches to a SQL Server machine and I'm getting the above error when a user tries to log in. The SQL server is setup to use Windows Auth. and I...
1
by: robert | last post by:
In a DAV scheme with PROPFIND or GET (PROPFIND /test/ HTTP/1.1) and Basic AUTH to a MS SharePoint over https server (AUTH required), he responds 'WWW-Authenticate: NTLM' only: reply: 'HTTP/1.1...
6
by: paladin.rithe | last post by:
I'm looking to use AJAX as part of the login system for a project, but I'm not finding what I'm looking for. I've seen the example of how to do an AJAX login, but that isn't really what I want....
2
by: ZeeHseez | last post by:
Hi, I have written a webbrowser application in VB .net Framework 1.1. I would like to suppress javascript error messages. However, the silent property of the webbrowser control suppresses the...
3
by: =?Utf-8?B?RHVrZSAoQU4yNDcp?= | last post by:
The majority of pages on our site need authentication (forms auth against the aspnetdb database). I created an '~/auth' folder with its own config file forcing authentication for any pages in the...
9
by: Josh | last post by:
I run a Joomla website and am familiar with php in some but not all aspects. Currently I am trying to find some solutions related to session handling. Am I correct in saying that "login" is kept...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.