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
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()