AJAX webservice call authentication

I am calling a WebMethods web service using the XMLHttpRequest object and when the request is sent, I get a user prompt to log into the server.  Is there a way to send the username/password with the POST request?

BTW, I know nothing of WebMethods.  I am merely interfacing with it.  I can put in my username and password and the request goes through, but I don't want my users to need to do this each time they send a query to the web service.  Also, I'm using Internet Explorer.

Thanks!
blawson7Asked:
Who is Participating?
 
blawson7Author Commented:
Solved!

I found out that prototype.js needs to be changed to take a username and a password as options to the request.  After changing the actual prototype.js file (which should have been fixed in version 1.5), the authentication is working.  I just pass the username and password into the post now.  Easy Peasy.

See...It didn't matter whether I was using .NET or IIS.  Pure javascript.
0
 
blawson7Author Commented:
Anyone?
0
 
masterpassCommented:
Are you using the .NET ? is the web service also being run by you ?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
masterpassCommented:
Try to use the Forms Authentication and disable the Windows authentication in the IIS server

Also have a look here : http://stackoverflow.com/questions/1879136/forms-authentication-and-post-requests-from-ajax
0
 
David RobitailleAnalyst ProgrammerCommented:
here something.
http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23842059.html
The actual class i use is a bit different, i keep the
WEBService as Private Shared in a class, so i dont have to reconnect eatch time i call it. But I think you got something to srtart with.
 
0
 
blawson7Author Commented:
No .NET - just javascript  

The web service is being run on the same domain, but not by me.  We have a WebMethods contractor (who happens to be out for a few weeks) who set up the services.

Since we use the authentication for other purposes, I don't want to disable the authentication in the IIS server.
0
 
masterpassCommented:
In that case, I guess,  you don't have much choices left
0
 
blawson7Author Commented:
Is .NET so awesome that you can so much more with it than all other non-microsoft frameworks?
0
 
masterpassCommented:
It is not the question of .NET. It is beacuse

1. you can't turn off the IIS Windows authentication
2. you can't modify the web methods( remember the web method is also function calls with specific signature)

If you are using Forms authentication then you can very well turn of Windows authentication in IIS with out any damage as it will still require the user to be logged in to use the web service .
0
 
David RobitailleAnalyst ProgrammerCommented:
masterpass was faster than me...
You said : "Since we use the authentication for other purposes, I don't want to disable the authentication in the IIS server."
Note that you dont have to disable it on the whole server. you could disable it only for that webservice.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.