Search Results for

    Show / Hide Table of Contents

    Class ChromeHttpLoginCredentials

    Provides credentials for IronPdf's embedded Chrome browser to log-in to an intranet, extranet or website, impersonating a user. This allows a unique ability to render web-pages as PDFs even on secure intranets, extranets and websites.

    Inheritance
    System.Object
    ChromeHttpLoginCredentials
    Namespace: IronPdf
    Assembly: IronPdf.dll
    Syntax
    public class ChromeHttpLoginCredentials : Object

    When ChromePdfRenderer must fetch a protected URL, ChromeHttpLoginCredentials carries the HTTP basic authentication username and password it sends through the Chromium engine. A single parameterless constructor gives you an instance with exactly two settable string properties. There is no static surface and nothing to dispose by hand.

    Reach for ChromeHttpLoginCredentials when RenderUrlAsPdf targets a page behind HTTP basic, digest, or NTLM authentication, including intranet dashboards, staging environments fronted by htpasswd, and reporting endpoints on a corporate domain. The credentials travel as standard authentication headers, so any server that accepts a browser's basic-auth prompt accepts them too. Cookie-based or form-based sessions are a different mechanism and use ApplyCookies instead.

    The canonical idiom is to construct the credentials, assign NetworkUsername and NetworkPassword, and attach the instance to the LoginCredentials property on a ChromePdfRenderer before calling any RenderUrlAsPdf overload. Both properties are plain strings; the class itself does no validation, encoding, or storage, so the surrounding application is responsible for sourcing the credentials from a secure store such as a secrets manager or environment variable. The same instance can also be passed to the ApplyCookies(string Url, ChromeHttpLoginCredentials Login) overload on ChromePdfRenderer when authentication and cookie capture both run against the same URL. Because there is nothing to dispose, a single configured instance can be assigned once and reused across every RenderUrlAsPdf call on the same renderer.

    using IronPdf;
    
    var renderer = new ChromePdfRenderer();
    
    renderer.LoginCredentials = new ChromeHttpLoginCredentials
    {
        NetworkUsername = Environment.GetEnvironmentVariable("REPORT_USER"),
        NetworkPassword = Environment.GetEnvironmentVariable("REPORT_PASS")
    };
    
    PdfDocument pdf = renderer.RenderUrlAsPdf("https://intranet.example.com/reports/q2");
    pdf.SaveAs("q2-report.pdf");

    The TLS website and system logins how-to demonstrates the NTLM, digest, and form-based variants, and the matching website and system logins example provides runnable code. When the protected resource sits behind a session cookie rather than an auth header, reach for the cookies how-to instead.

    Constructors

    ChromeHttpLoginCredentials()

    Declaration
    public ChromeHttpLoginCredentials()

    Properties

    NetworkPassword

    Optional: Password credential for Windows / Linux network security authentication.

    Declaration
    public string NetworkPassword { get; set; }
    Property Value
    Type Description
    System.String

    NetworkUsername

    Optional: User-name credential for Windows / Linux network security authentication.

    Declaration
    public string NetworkUsername { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    Finalize()

    Destructor cleans up all temporary cookies files for the HttpLoginCredentials instance.

    Declaration
    protected override void Finalize()
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    IronPDF_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronPDF