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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

blawson7Author Commented:
Anyone?
0
masterpassCommented:
Are you using the .NET ? is the web service also being run by you ?
0
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.