Solved

User authentication with MSXML object

Posted on 2002-03-20
4
990 Views
Last Modified: 2012-08-14
Hi,


I'm using the MSXML object in some VBA code to retrieve data and load it into Excel 97. Excel is being run form within IE5 by redirecting to https://hostname/aa/bbb/file1.xls

The source of the data being called by the Excel VBA code is on a secure server so I need the call to be authenticated. The web server is not an IIS server.

The code used is bascially:

Set LoadXML = CreateObject("MSXML.DOMDocument")
LoadXML.async = False
LoadXML.Load ("https://hostname/file.xml")

The Load method is failing because it is either trying to parse the authentication screen or if I use a modal dialog login then it fails with Access is Denied.

The user will already have authenticated on the server to get to that point. So why is the MSXML object not using the users current IE5 authenticated session ?


No each call is going to be unique. I cannot use a call similar to setProxyCredentials() as I won't know a specific username and password - these should come form the IE5 session.


Any ideas ?



Many thanks,

Alex


0
Comment
Question by:Alex_Gould
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:b1xml2
ID: 6884393
Firstly, you shd be using the latest parsers: MSXML3/4. The older parsers cannot use HTTPS whatsoever...

Progid for DOMDocument30
"Msxml2.DOMDocument.3.0"

Progid for DOMDocument40
"Msxml2.DOMDocument.4.0"

Basically, you are creating a new session regardless of current session when you specify the full URL. Secondly, because it is within excel, even if Excel is instantiated from within Internet Explorer, you will be having a new session, whether you like it or not.

It is a pain trying to connect using HTTPS as the Parser does not support cross protocols:

1. From HTTP to HTTPS.
2. From HTTPS to HTTP.
3. From an ActiveX Container to HTTPS.

Furthermore, it is only with MSXML3 SP1+ that SSL client certificates are supported but the way to install it can be pretty convoluted.

The call to the file MUST originate from a web page within the SSL DOMAIN (in other words HTTPS)

Hence, this will work within a web page on the web app
<script language="vbscript">
Set LoadXML = CreateObject("MSXML.DOMDocument")
LoadXML.async = False
LoadXML.Load ("file.xml")
</script>

Support for authentication for the XML Parser takes the form of BASIC AUTHENTICATION and that means it is really not secure: cleaar text.

What I suggest is the following:

1. Use a web page that embeds the EXCEL document
2. Have client-side scripts load the XML document
3. Pass the data to the Embedded OBJECT.

It is not a problem is the web server is NOT IIS.



0
 

Author Comment

by:Alex_Gould
ID: 6893085
Thanks very much for your comprehensive answer.

Sorry for the delay.

I am checking all these cases and will get back to you shortly.


Ideally, I didn't want to have to install any 3rd party s/w, drivers, parsers, etc.

If I have to (and it seems like we will) then so be it.



Thanks,

Alex
0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 300 total points
ID: 6895478
Alex, there can be an on-demand web-based installation of MSXML3 SP1. This is useful both for the Internet as well as the Intranet. That way, you really don't have to slave and force install on ALL boxes. =)
0
 

Author Comment

by:Alex_Gould
ID: 6914853
Thanks again for the pointers.

Whilst this isn't a solution - it's now clear to me that there isn't going to be one.

Well, at least, not as easy as I was hoping.

You've given me enough information to build on.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

627 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