Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

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

Open
jlvale opened this issue Apr 25, 2019 · 5 comments
Open

Comments

@jlvale
Copy link

jlvale commented Apr 25, 2019

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?

@msokk
Copy link
Owner

msokk commented Apr 26, 2019

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

@jlvale
Copy link
Author

jlvale commented Apr 26, 2019

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

@msokk
Copy link
Owner

msokk commented Apr 26, 2019

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.

@jlvale
Copy link
Author

jlvale commented Apr 26, 2019

What alternative do you recommend?

@msokk
Copy link
Owner

msokk commented Apr 27, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants