Authenticate Windows Authentication using Javascript

Sency picture Sency · Jul 19, 2011 · Viewed 36.8k times · Source

I have to transfer my client from one website to another website. This happens in client side. In this 2nd website, its using windows basic authentication system. So It popups the login window. I need to omit this Popup window and authenticate my client on 2nd website using javascript and then redirect him to 2nd website. There is no security issue even I put credentials in javascript file since this whole system is running in Intranet. So How to authenticate client on 2nd website ?

I found this thread How can I pass windows authentication to webservice using jQuery?

But it does not work. When I look the request header of 2nd url, It does not contain the Authorization tag.

Answer

William Niu picture William Niu · Aug 21, 2011

If it is basic authentication and you don't mind exposing the credential, why don't you simply insert username and password into the URL? For example:

http://username:[email protected]

But if you have control over the Web server, you really should disable authentication for intranet connections.