?
Solved

Using both AUTH_USER and ServerXMLHTTP Issue

Posted on 2007-10-12
6
Medium Priority
?
709 Views
Last Modified: 2010-05-18
I have a section of our intranet that I have removed anonymous access so I can grab the visitors network username. I have done this because some visitors have access to certain sections and forms. Plus so I can keep track of who has submitted what without having them log in (people here are tired of having to log into this or that)

On the main section of our intranet I have a page that shows the latest additions and updates. That information comes from a database that stores the page content, title and last modification of that page.

The data in that database is processed by using a combination of reading the page XMLHTTP to get the current page content and FileSystemObject to get the last mod date of that page. This process is triggered by either a form I submit after updating articles on our intranet or an included process when other data is updated. For example; when someone submits something to the company news section, part of my submit process will use XMLHTTP to read the content of that page (so it will grab what a visitor will see) and (after stripping the HTML) will save that in a database and use now() as the last mod date. I also use that DB table for searching.

So, anyway, I needed to explain all that to get to this&
On the sections of our intranet that I have anonymous access turned off the XMLHTTP does not work because ISUR (which I am guessing xmlhttp uses) is not an authenticated user and I actually get a 401 xmlHTTP.Status. Unfortunately, if I enable anonymous access (even with the authenticated access boxes checked) I am unable to grab Auth_User.

Is there a way I can have both my xmlhttp to work and also be able to grab Request.ServerVariables("AUTH_USER")?  I am using IIS 6 on a Windows 2003 server.

A screenshot of my permissions can be seen at: http://www.cumminsnorthwest.com/MiscImg/IISAccess.jpg

Here is the code I am using for my xmlhttp:
Set xmlHTTP = CreateObject("MSXML2.ServerXMLHTTP.3.0")
xmlHTTP.open "GET", "http://infopage.cummins.com/CSE/Tools/Minutes.asp", false
xmlHTTP.send()
CurrentPage = xmlHTTP.ResponseText
CurrentStatus = xmlHTTP.Status
CurrentReadiness = xmlHTTP.readyState
If CurrentStatus = 200 AND CurrentReadiness = 4 Then
   'Function that grabs title from the page
   TheTitle = GetTitle(CurrentPage)
Else
   Response.Write "Page Unavailable"
End If
Set xmlHTTP = Nothing
Response.Write "<br>" & TheTitle & "<br>"

Thanks in advance for your help,
Soren

0
Comment
Question by:swinslow
  • 3
5 Comments
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20067184
Is there a way I can have both my xmlhttp to work and also be able to grab Request.ServerVariables("AUTH_USER")?  The answer to this is NO until you dont provide anonymous access turned to ON
0
 
LVL 4

Author Comment

by:swinslow
ID: 20067567
There has to be someway to work around it or a different way to approach it.

Soren
0
 
LVL 4

Author Comment

by:swinslow
ID: 20086746
I have it figured out. I just needed to pass a network username and password along with my xmlhttp request.
xmlHTTP.open "GET", TheURL, false, NetworkUserName, NetworkPassword
0
 
LVL 4

Author Comment

by:swinslow
ID: 21097251
A refund works for me, especialy since I was able to figure it out myself (solution is posted in my last comment).
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 21130347
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question