kolbasa/cordova-plugin-apkupdater

Allow custom headers or at least Bearer authentication

Closed this issue · 2 comments

Right now there's only place to put basic auth and then it gets converted to "Basic $TOKEN(base64)":
https://github.com/kolbasa/cordova-plugin-apkupdater/blob/f98e939ba21c7d8fcbae3e2bc72a797c59c08096/src/android/downloader/FileDownloader.java#L46C41-L46C41

I think it would be more useful if we could just send whatever headers we want (or at least Authorization header in general).
If this is not possible at least another option in the download method to be able to send a Bearer token would be appreciated.

So then we could just have "Authorization": "Bearer $TOKEN" - no need for base64 here as it could be a JWT directly.

Thanks for your work!

Sorry for the delay. I missed this because of all the holidays.
I have published a new version.
basicAuth has been replaced by authorization.
You can use this to pass a custom auth token.
Let me know if something doesn't work.

Sorry for the late response and for answering on a closed issue but I wanted to say that the new version works.
Thank you and I hope you had some wonderful holidays!