Skip to main content

HTTP Basic Authentication with XMLHttpProxy

2 replies [Last post]
vishalz
Offline
Joined: 2008-09-20
Points: 0

Hi There,
I am trying to access a Restful web service that requires HTTP Basic Authentication. Does the XmlHttpProxy support HTTP Basic authentication?

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31
Points: 0

Hi,

You can use Basic Authorization with the XMLHttpProxy

Define it in your xhp.json file service definition like :

{"id": "jj",
"url":"http://someservice.com/blahservice",
"username" : "myname",
"password" : "socool"
},

You want to make sure you don't have the xhp.json file in a web accessible directory.

I keep mine in /WEB-INF/ where a user can not access.

To do this you will need You will need a context param like :

jmaki-xhp-resources /WEB-INF/

Find out more here :

https://ajax.dev.java.net/xmlhttpproxy.html

-Greg

vishalz
Offline
Joined: 2008-09-20
Points: 0

Hi Greg,
Thanks for the prompt response . It works :) .

Hey is there someplace I can find the comprehensive list of parameters that can be configured to tweak the behavior of the XMLHTTPProxy object? I know of the following:

id":
"url":
"apikey"
"xslStyleSheet"
"defaultURLParams"
"username"
"password"

Thanks
Vishal