How to update Token to httpclient object/ all the async calls triggered from windows client while few are in progress - access-token

We have a Windows application which reads a batch of files and upload them to server in loop.
this batch of files are being uploading using httpclient.sendAsync.
where after few file uploads are in progress or waiting the bearer token expires and has to be updated.
If updated to client.DefaultAuthorizationHeaders, getting error "cannot access disposed object".
is there any way to update the client authorization headers so other requests which are in queue gets success full?

Related

OAuth Access token expired while uploading large file to the server

I have web application where I am uploading the large file more than 1 GB from browser to the server. Depending on network speed some time it will take more than 1 hour.
Server endpoint is secured with OAuth.
When upload request is sent from browser it has valid token with 1 hour expiry.
In case of large file upload, it gives Unauthorised error because of token expiry after 1 hour.
How can I solve this problem where token should validate only in the beginning of the request not after complete file upload?
Technology used
AngularJs - UI
SpringBoot version 2 - Backend
POST request
Content-Type: Multipart/form-data
I dont have option to increase the token expiry beyond 1 hour.
The reason is that the tomcat will receive the file firstly, then dispatch the servlet request to your controller. When the upload takes too long time and the token has already expired, the security check will return 401, and your request will never enter the controller (the security check is before your controller).
You can put a breakpoint in your controller with the MultiPartFile parameter, then try to upload a huge size file to verify what I said.
One possible solution is you resolve the servlet yourself, maybe something like:
uploadFile(HttpServletRequest rawRequest)
Then when a token already expired, you can refresh it rather than return 401 then discard the already uploaded file.
Hope this may help you, and if you have a better idea, please let us know. Thank you!
useful link: https://docs.spring.io/spring-framework/docs/5.3.x/reference/html/web.html#mvc-multipart

How to check Global HTTP batch endpoint is called

I received an email saying that JSON-RPC and Global HTTP Batch serving endpoints being discontinued, and that my project on Google Cloud Platform is calling Global HTTP Batch endpoint.
When I check the API dashboard of the project, however, "Google Cloud Storage JSON API" shows no usage for the last 30 days.
Does that mean the project no longer calls this endpoint?
If not (= if there is still a chance that we call this endpoint), how can I see whether a change that I will make to eliminate the call does actually eliminate the call?
If you are using a client from Google to make your request you are no longer calling the Global HTTP Batch endpoint as they have been updated to use the new API specific Batch endpoint.
You can still use the dev tools from your browser to check the request url from your app.

Ajax request pending when run on async

i have a page that make 10 - 20 ajax request to load data from background. But as i look in mozilla developer tools network status, even all request is shown, processed request still run in fifo
you can see my network status screenshot
here
fyi, this is internal request and not cross-platform request and i use laravel 5.5 for application and axios to make ajax request
is this kind of flow (request executed in fifo order) is normal in async request?
or maybe i need to set something in my web server?
Thanks

Fineuploader issues with Norton AV

We are noticing users with Norton antivirus aren't able to upload direct to Aws s3. There is a 403 error thrown on the s3 url. We have traced this to being very specifically Norton users only and happens in both ie and chrome
here are the console errors
request for 0
https://****.s3.amazonaws.com/****.mp4?uploads Failed to load resource: the server responded with a status of 403 (Forbidden)
custom.fineuploader-5.0.9.min.js:25 [Fine Uploader 5.0.9] POST request for 0 has failed - response code 403
custom.fineuploader-5.0.9.min.js:25 [Fine Uploader 5.0.9] Specific problem detected initiating multipart upload request for 0: 'The difference between the request time and the current time is too large.'.
custom.fineuploader-5.0.9.min.js:25 [Fine Uploader 5.0.9] Chunked upload request failed for 0, chunk 0
**** used in place of real information
The log messages (added after the question was posted) suggest that the issue is with a clock drift on the user's machine. It's not clear how this is related to Norton. If the clock on the user's machine drifts too far from the actual time, then AWS will reject the request. You'll need to be sure that the machine clock is reasonably accurate.
A similar question was asked at Fine Uploader getting "Policy expired" message sending to S3 for some.

Ajax post servlet response timeout

I use Apache common-fileupload to upload image to my sever successfully.Then I want to use progress listener to monitor progress and store progress into session when uploading image.I use fileupload servlet to upload file and another servlet to receive ajax request (post) to get session every 0.5 second. But I found that when i uploading image,ajax request time out,and when I stop upload in midway,ajax request successfully and response session value.I really don't know why,you can try it here: cloudimages.sinaapp.com

Resources