留言板

DownloadUtil auth error

Ibon Gañan,修改在7 年前。

DownloadUtil auth error

New Member 帖子: 3 加入日期: 14-7-25 最近的帖子
Hi,

I'm developing an Android App with a liferay 7 backend.
Until now I have succesfully used severl Liferay screenlest like Login, and even my own built services with Services Builder.

But I'm trying to use the DownloadUtil class to download a .pdf document from my backend, and allways get the same error. The error is "java.net.ProtocolException: Too many follow-up requests: 21" but debugging I found that this error is caused by another one related with the authentication.

Error 401 (Athentication) in the response value at line 299 in the class com.squareup.okhttp.Call


 Session session = new SessionImpl(context.getString(R.string.liferay_server), new DigestAuthentication("user","pass"));

Callback sessioncallback = new StringCallback() {
             public void onFailure(Exception exception) {
                    // Implement exception handling code
                    exception.printStackTrace();
              }
              public void onSuccess(String result) {
                    Log.d("TRACE--", result);
               }
};

session.setCallback(sessioncallback);

DownloadUtil.downloadWebDAVFile(
                    session,
                   PortalVersion.V_7,
                    "guest",
                    "Folder",
                    "File.pdf",
                   callback
);


All parameters looks ok, because I debugged the Liferay code and the formed url to call HttpUtil.download method inside DownloadUtil.downloadWebDAVFile method, is OK (I tested it with mi internet browser and its shows my pdf document).

Regards,
Ibon.
thumbnail
Bruno Farache,修改在7 年前。

RE: DownloadUtil auth error

Liferay Master 帖子: 603 加入日期: 07-5-14 最近的帖子
For some reason you are getting infinite redirects:

https://github.com/square/retrofit/issues/1561