Hi,

If you are connecting using Java you have to provide the HTTP Basic
authentication header containing your credentials. We generally use the
Apache HttpComponents (or HttpClient) libraries to to HTTP connections.
See also the Integration tests, where we are leveraging HttpClient to
fire requests at Sling.

In HttpClient (I assume HttpComponents is similar) you would create a
Credentials object with the user name and password and registering with
the HttpClient object so that it is transparently used as requested by
the server.

Using the user name and password in the URL does not work.

Hope this helps.

Regards
Felix


Am Freitag, den 19.11.2010, 04:39 -0800 schrieb Zhongmiao Li: 
> Hi,     I   have got stuck in a very  strange problem and hope anycould help
> me!
> 
> The address I use to access Sling is as follows:
> 
> http://admin:ad...@141.83.80.149:8080/content/nemoclient?sling:authRequestLogin=1
> 
> On my own computer ( the computer running Sling, whose Ip Address
> is 141.83.80.149), I can connect to Sling properly in Java program(Using
> HttpUrlConnection).  However, I can not connect to the server  in my  Java
> program on another computer! The error code is 401, Unauthorized.
>  But I can upload  and download files on any computer by HTML form. So can
> anyone help me to solve this problem?
> 


Reply via email to