Solved

User authentication with MSXML object

Posted on 2002-03-20
4
979 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

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 …
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 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