authenticate
Provides credentials for HTTP authentication (RFC 7235). When set, any HTTP
authentication challenge (401/407) will be answered with the supplied
credentials automatically. If an origin is provided, only challenges whose
origin matches will use these credentials; otherwise every challenge is
answered (Puppeteer-style).
**Usage Example — authenticate all requests:**
mutation AuthenticateAndNavigate {
authenticate(username: "user", password: "pass") {
time
}
goto(url: "https://httpbin.org/basic-auth/user/pass") {
status
url
}
}
**Usage Example — scope credentials to a specific origin:**
mutation AuthenticateProxy {
authenticate(
username: "proxyUser"
password: "proxyPass"
origin: "http://my-proxy.example.com:8080"
) {
time
}
goto(url: "https://example.com") {
status
}
}
**Field Definition:**
authenticate(
username: String!
password: String!
origin: String
): HTTPResponse
Arguments
authenticate.username ● String! non-null scalar
The username to authenticate with
authenticate.password ● String! non-null scalar
The password to authenticate with
authenticate.origin ● String scalar
The origin of the requests needing authentication, specified as a full
HTTP origin in protocol://host(:port) format (e.g.
https://example.com). If not provided, every request needing
authentication will use the provided credentials.
Type
HTTPResponse object
Response returned after a navigation event