Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE automation with IE and basic authentication
Message
De
01/07/2014 10:03:56
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01602885
Message ID:
01602980
Vues:
52
>I found this: http://watirmelon.com/2010/11/24/elegantly-handling-basic-browser-authentication-with-watir/
>
>It basically says you can do this using a URL like this:
>
>http//username:password@yourwebsite.com
>
>However, it is disabled by default so you'd need to edit the registry to re-enable it:
>
>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE
>
>by adding iexplore.exe and setting a DWORD value of 0 and adding explorer.exe and doing the same.

Yes, that support is not there by default.

I was more looking into something like this:
        Dim lcHeader As String = ""
        Dim loInternetExplorer As Object = Nothing
        Dim loString As Framework.StringFunction = New Framework.StringFunction(oApp)

        ' Convert to Base64
        loString.cText = "username:password"
        If Not loString.ConvertToBase64FromText() Then
            MessageBox.Show(loString.cMessage)
        End If

        lcHeader = "Authorization: Basic " + loString.cEncoded + oApp.cCR

        ' Sharepoint
        loInternetExplorer = CreateObject("InternetExplorer.Application")
        loInternetExplorer.Visible = True
        loInternetExplorer.Navigate2("https://something.domain.com/SitePages/Home.aspx", Nothing, Nothing, lcHeader)
The problem here is that https://something.domain.com/SitePages/Home.aspx is the main entry point. But, when the basic authentication appears, it indicates somethingelse.domain.com. This is like that because the company where this resides only has one IP public. So, they have some kind of alias inside. I think this is why the basic authentication would not work with this code. I will have to try this against another test site which is working with the same domain throughout the entire authentication.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform