electron-render-service icon indicating copy to clipboard operation
electron-render-service copied to clipboard

How to use the service with a wikimedia page that needs authentication?

Open jlvale opened this issue 5 years ago • 5 comments

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?

jlvale avatar Apr 25 '19 19:04 jlvale

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

msokk avatar Apr 26 '19 14:04 msokk

It's a login page for a private wiki, we integrated the authentication with the Active Directory service.

jlvale avatar Apr 26 '19 16:04 jlvale

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.

msokk avatar Apr 26 '19 18:04 msokk

What alternative do you recommend?

jlvale avatar Apr 26 '19 20:04 jlvale

Probably it would be easiest to script a puppeteer flow in Node.js yourself - https://blog.risingstack.com/pdf-from-html-node-js-puppeteer/

msokk avatar Apr 27 '19 09:04 msokk