Credentials

Direct Username/Password Credentials

CredentialServiceType.None is the baseline credential source: WithUsername and WithPassword set the values directly, and SaveTo(grid) appends a single [Username, Password] row built from those values - no vault is queried, and GetCredentialsFor/WithDomain have no effect. This is the same shape used internally by WithCredentials to build a master login for the password-manager services.

NOTE

WithWebAuth(WebAuthType) records how a site expects to be given a credential, so GPAL knows what to do with it instead of leaving the workflow to work it out. Basic, Proxy and Bearer are settled before the first request and need nobody. Digest is a challenge and response, so it cannot be sent ahead of the challenge and the browser answers it itself. XAuthToken, XApiKey and ApiKey present a token the workflow already holds. Form is a page like any other: GPAL holds the credential so it lives in one place, and the workflow drives the fields with selectors, because there is no other way in.

Examples

GPAL Fluent: High-level fluent C# API

//SaveTo(grid) appends a [Username, Password] row regardless of ServiceType, so the same FillInFrom step works whether the credentials came directly from code, a password manager vault, or were built as a master login for WithCredentials.

// Direct username/password - no password manager involved

var grid = GPAL.Grid.ToGPALObject();

ICredentials login = GPAL.CredentialsFor(CredentialServiceType.None)

.WithUsername("admin@example.com")

.WithPassword("s3cret")

.ToGPALObject();


login.SaveTo(grid);


// Use the grid to fill in a login form

GPAL.Browser

.GoTo("https://example.com/login")

.WithSelector("#username")

.WithSelector("#password")

.FillInFrom(grid)

.WithSelector("#login")

.LeftClick();

💬 Ask GPAL