Solved

User authentication with MSXML object

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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