Is it possible to get the headers and response text from the forge.request.ajax error callback?

I am trying to set up a trigger.io project that uses HTTP Digest Authentication. So far, I only tested things in the Android emulator.

I have a separate version of JavaScript that uses jQuery, which I use as a base. In jQuery version, Digest Authentication starts by sending the header "401 Not Authorized" along with nonce, etc. In the custom header is "WWW-Authenticate-JS". Using a custom header instead of "WWW-Authenticate" prevents the browser from starting its own authentication form. However, the error callback in forge.request.ajax does not seem to have access to this data. When I give the answer, none of the data sent by the server exists, except that the header was 401.

Is it possible to access the returned headers and body from an error callback? If so, what do I need to do to access this data?

I also tried using the standard Digest Authentication header for trigger.io calls, but this leads to NULL pointer errors in the io.trigger.forge.android.modules.request.API file, in particular in the getPasswordAuthentication method. Can forge.request.ajax be configured to automatically use Digest authentication when returning a standard header?

+4
source share

Source: https://habr.com/ru/post/1445868/


All Articles