Search code examples
internet-explorerweb-applicationsbasic-authentication

HTTP Basic Auth protected url in new window


We have an application which is protected using HTTP basic authentication.

We need to access few urls from above application in another client web application.

When ever we click on these protected urls they should come-up in new pop-up window.

We did

window.open("http://username:password@server:port/appcontext/otherparams");

This works fine in Firefox and Chrome, but not in Internet explorer. After some google we figured that Internet Explorer doesn't support above formatted url.

Is there any alternative ways we can make this working in all browsers?

EDIT:

Is there anyway we can move authentication to server end and achieve same functionality. I know we could use

Authenticator.setDefault

But not sure on how can we land back again in pop-up window after authentication. Any help would be appreciated.

Thanks for your time.


Solution

  • Take a look at this article which gives a lot of information on this issue.

    As explained in the article, to enable username/password in url's you can edit the registry database in the following way:

    To disable the new default behavior in Windows Explorer and Internet Explorer, create iexplore.exe and explorer.exe DWORD values in one of the following registry keys and set their value data to 0.

    For all users of the program, set the value in the following registry key:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE
    
    For the current user of the program only, set the value in the following registry key:
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE