Foren

DownloadUtil auth error

Ibon Gañan, geändert vor 7 Jahren.

DownloadUtil auth error

New Member Beiträge: 3 Beitrittsdatum: 25.07.14 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: DownloadUtil auth error

Liferay Master Beiträge: 603 Beitrittsdatum: 14.05.07 Neueste Beiträge
For some reason you are getting infinite redirects:

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