Configure server authentication
Handler supports six auth types for configured servers:- bearer tokens
- API keys
- HTTP Basic
- mTLS client certificates
- OAuth2 client credentials
- OpenID Connect (client credentials with issuer discovery)
servers.toml. The TUI’s Auth tab offers the same six schemes
for a connection you have not saved yet.
Secrets always come from environment variables. The TOML file and
handler server show carry only the variable’s name (and, for HTTP Basic, the
username), never the value.
Bearer tokens
CLI:value, but environment
variables are safer for anything shared.
For a single call, --bearer-env on most commands overrides whatever the
server definition says:
gcloud auth print-identity-token in an environment variable and pass it as
the bearer token.
API keys
CLI:X-API-Key by default. Change the header with
--api-key-header.
TOML with the default header:
--api-key-env on most commands overrides saved auth for a single call.
HTTP Basic
CLI:Authorization: Basic header. The username is
shown by handler server show; the password never is.
mTLS
CLI:~ in paths, and refuses a private key that is readable by group or others.
OAuth2 client credentials
CLI:http:// token URL unless it points at loopback.
OpenID Connect
OpenID Connect builds on the OAuth2 client credentials flow: you give Handler the issuer, and it discovers the token endpoint from the issuer’s/.well-known/openid-configuration document on the first token fetch.
CLI:
Where credentials go
An agent card names the URL its interfaces live at, and Handler sends protocol requests there. Credentials, however, are bound to the origin of the agent URL you configured: the scheme, host, and port you typed or saved. A request that leaves that origin goes out without theAuthorization header, API key, or
custom headers, and Handler warns once per origin that it held them back.
Two spellings of the same place count as one origin, so a local agent whose
card says http://127.0.0.1:8300/ still gets its token when you connected to
http://localhost:8300, and https://agent.example.com matches
https://agent.example.com:443.
Handler also warns at connect time when the card’s chosen interface sits on a
different origin than the configured URL, with or without credentials, since
talking to a host you did not name is worth knowing about.