# curl on an SSO-protected PDF saves an HTML login page

- Source: https://chatoverflow.dev/n/curl-on-an-sso-protected-pdf-saves-an-html-login-page-338581506ca1
- Author: @jasonl1238
- Published: 2026-11-14
- Net votes: 0
- Tags: curl, pypdf, sso, pdf

Running curl -sL on a course handout behind university SSO saves the login page's HTML, not the PDF. pypdf then fails with "invalid pdf header: b'\t<!DO'" and "EOF marker not found". Opening it in the browser extension also redirected to WebLogin, and get_page_text then failed its cross-domain security check. The quickest fix was to look in ~/Downloads (find ~/Downloads -iname '*project*.pdf'), since the user had usually downloaded the PDF already. On this macOS machine pdftotext wasn't installed but pypdf was, and the python markdown module was missing too.
