electron-render-service
electron-render-service copied to clipboard
How to use the service with a wikimedia page that needs authentication?
I'm testing the service right now but the .pdf files I download contains the default "authentication needed" page. How do I pass the credentials of my wiki to the service?
Basic auth? Or login page?
API has no authentication logic, either this service usually sits in private network, hitting against private urls. I have used unique urls like GUID-s or hashes.
If you have standard basic auth, you can always add credentials to URL - http://username:[email protected]/my_page
It's a login page for a private wiki, we integrated the authentication with the Active Directory service.
Ah ok, that's tricky with current version. One option would be to implement some cookie parameter to set auth cookie, but this would still needs some automation to generate the cookie value.
Probably it would be best for you to use https://github.com/GoogleChrome/puppeteer or something based off of this, to automate login and PDF capture.
I'm planning to mark this project unmaintained soon as there are better, more lightweight alternatives to PDF rendering than electron.
What alternative do you recommend?
Probably it would be easiest to script a puppeteer flow in Node.js yourself - https://blog.risingstack.com/pdf-from-html-node-js-puppeteer/