[{"data":1,"prerenderedAt":142},["Reactive",2],{"/guides/curl/accessing-secured-pages/":3,"related:PWTWA6KFsw":60},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"language":10,"library":10,"property":11,"output":12,"related":13,"default":15,"body":16,"_type":55,"_id":56,"_source":57,"_file":58,"_extension":59},"/guides/curl/accessing-secured-pages","curl",false,"","Accessing secured pages","Learn how to access secured pages when converting HTML to PDF using cUrl. This how-to guide offers clear cUrl code examples that show developers how to implement this using the PDFShift API.","cUrl","source","pdf",[14],"convert-html-to-pdf-from-a-url",true,{"type":17,"children":18,"toc":52},"root",[19,27,40,45],{"type":20,"tag":21,"props":22,"children":23},"element","p",{},[24],{"type":25,"value":26},"text","In this guide, we'll show you how to access secured pages when converting HTML to PDF using PDFShift's API.",{"type":20,"tag":28,"props":29,"children":34},"pre",{"code":30,"language":31,"meta":7,"className":32},"# You can get an API key at https://pdfshift.io\nAPI_KEY=\"sk_xxxxxxxxxxxx\"\n\n# Access a secured page\ncurl -X POST \"https://api.pdfshift.io/v3/convert/pdf\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: ${API_KEY}\" \\\n  -d '{\"source\": \"https://www.example.com/secured\", \"auth\": {\"username\": \"user\", \"password\": \"pass\"}}' \\\n  -o \"result.pdf\"\n","bash",[33],"language-bash",[35],{"type":20,"tag":36,"props":37,"children":38},"code",{"__ignoreMap":7},[39],{"type":25,"value":30},{"type":20,"tag":21,"props":41,"children":42},{},[43],{"type":25,"value":44},"With this cUrl command, you can access secured pages by providing authentication credentials. Happy coding!",{"type":20,"tag":28,"props":46,"children":47},{"code":7},[48],{"type":20,"tag":36,"props":49,"children":50},{"__ignoreMap":7},[51],{"type":25,"value":7},{"title":7,"searchDepth":53,"depth":53,"links":54},2,[],"markdown","content:guides:curl:accessing-secured-pages.md","content","guides/curl/accessing-secured-pages.md","md",[61,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138],{"_path":4,"title":8,"language":10,"library":10,"_id":56},{"_path":63,"title":64,"language":10,"library":10,"_id":65},"/guides/curl/adding-a-custom-header-or-footer","Adding a custom header or footer","content:guides:curl:adding-a-custom-header-or-footer.md",{"_path":67,"title":68,"language":10,"library":10,"_id":69},"/guides/curl/adding-a-text-watermark","Adding a text watermark","content:guides:curl:adding-a-text-watermark.md",{"_path":71,"title":72,"language":10,"library":10,"_id":73},"/guides/curl/adding-an-image-watermark","Adding an image watermark","content:guides:curl:adding-an-image-watermark.md",{"_path":75,"title":76,"language":10,"library":10,"_id":77},"/guides/curl/avoid-conversion-on-error","Avoid conversion on error","content:guides:curl:avoid-conversion-on-error.md",{"_path":79,"title":80,"language":10,"library":10,"_id":81},"/guides/curl/convert-html-to-pdf-from-a-url","Convert an HTML document to PDF from a URL","content:guides:curl:convert-html-to-pdf-from-a-url.md",{"_path":83,"title":84,"language":10,"library":10,"_id":85},"/guides/curl/convert-html-to-pdf-from-raw-html","Convert an HTML document to PDF from raw HTML","content:guides:curl:convert-html-to-pdf-from-raw-html.md",{"_path":87,"title":88,"language":10,"library":10,"_id":89},"/guides/curl/define-a-time-limit","Define a time limit","content:guides:curl:define-a-time-limit.md",{"_path":91,"title":92,"language":10,"library":10,"_id":93},"/guides/curl/exporting-only-a-specific-set-of-pages","Exporting only a specific set of pages","content:guides:curl:exporting-only-a-specific-set-of-pages.md",{"_path":95,"title":96,"language":10,"library":10,"_id":97},"/guides/curl/generate-a-document-with-full-height","Generate a document with full height","content:guides:curl:generate-a-document-with-full-height.md",{"_path":99,"title":100,"language":10,"library":10,"_id":101},"/guides/curl/loading-css-from-a-string","Loading CSS from a string","content:guides:curl:loading-css-from-a-string.md",{"_path":103,"title":104,"language":10,"library":10,"_id":105},"/guides/curl/loading-css-from-a-url","Loading CSS from a URL","content:guides:curl:loading-css-from-a-url.md",{"_path":107,"title":108,"language":10,"library":10,"_id":109},"/guides/curl/loading-javascript-from-a-string","Loading JavaScript from a string","content:guides:curl:loading-javascript-from-a-string.md",{"_path":111,"title":112,"language":10,"library":10,"_id":113},"/guides/curl/loading-javascript-from-a-url","Loading JavaScript from a URL","content:guides:curl:loading-javascript-from-a-url.md",{"_path":115,"title":116,"language":10,"library":10,"_id":117},"/guides/curl/protecting-the-generated-pdf","Protecting the generated PDF","content:guides:curl:protecting-the-generated-pdf.md",{"_path":119,"title":120,"language":10,"library":10,"_id":121},"/guides/curl/receive-a-webhook-event","Receive a webhook event","content:guides:curl:receive-a-webhook-event.md",{"_path":123,"title":124,"language":10,"library":10,"_id":125},"/guides/curl/save-your-pdf-online-and-get-back-a-url","Save your PDF online and get back a URL","content:guides:curl:save-your-pdf-online-and-get-back-a-url.md",{"_path":127,"title":128,"language":10,"library":10,"_id":129},"/guides/curl/save-your-pdf-to-your-amazon-s3-bucket","Save your PDF to your Amazon S3 bucket","content:guides:curl:save-your-pdf-to-your-amazon-s3-bucket.md",{"_path":131,"title":132,"language":10,"library":10,"_id":133},"/guides/curl/send-custom-http-headers","Send custom HTTP headers","content:guides:curl:send-custom-http-headers.md",{"_path":135,"title":136,"language":10,"library":10,"_id":137},"/guides/curl/using-cookies","Using cookies","content:guides:curl:using-cookies.md",{"_path":139,"title":140,"language":10,"library":10,"_id":141},"/guides/curl/waiting-for-a-custom-element-to-be-ready","Waiting for a custom element to be ready","content:guides:curl:waiting-for-a-custom-element-to-be-ready.md",1796403669311]