Skip to content

Authentication

Orb supports multiple authentication methods for HTTP requests.

Use -u or --user with the format username:password:

Terminal window
orb -u alice:secret123 https://api.example.com/protected

This sends an Authorization: Basic <base64> header where <base64> is the Base64-encoded username:password string.

If you omit the password, orb will use an empty password:

Terminal window
# Empty password
orb -u alice: https://api.example.com/protected
Terminal window
orb -u "alice:${API_PASSWORD}" https://api.example.com/protected

Use --bearer to send a bearer token:

Terminal window
orb --bearer "eyJhbGciOiJIUzI1NiIs..." https://api.example.com/protected

This sends an Authorization: Bearer <token> header.

Terminal window
# OAuth2 access token
orb --bearer "${ACCESS_TOKEN}" https://api.example.com/me
# JWT token
orb --bearer "$(cat token.txt)" https://api.example.com/protected
# API key as bearer token
orb --bearer "${API_KEY}" https://api.example.com/data

For other authentication schemes, use the -H flag:

Terminal window
# API Key in header
orb -H "X-API-Key: your-api-key" https://api.example.com
# Digest auth (manual)
orb -H "Authorization: Digest username=alice, ..." https://api.example.com
# AWS Signature
orb -H "Authorization: AWS4-HMAC-SHA256 ..." https://api.example.com

Authentication with Client Certificates (mTLS)

Section titled “Authentication with Client Certificates (mTLS)”

For mutual TLS authentication, use --cert and optionally --key:

Terminal window
orb --cert client.pem --key client-key.pem https://secure.example.com

See TLS & SSL for detailed certificate configuration.

You can combine other auth methods:

Terminal window
# Bearer token + API key header
orb --bearer "${TOKEN}" \
-H "X-API-Key: ${API_KEY}" \
https://api.example.com
# Basic auth + client certificate
orb -u alice:password \
--cert client.pem \
https://secure.example.com
Terminal window
# Get user profile
orb --bearer "${TOKEN}" https://api.github.com/user
# Create a resource
orb --bearer "${TOKEN}" \
-X POST \
--json '{"name": "New Resource"}' \
https://api.example.com/resources
Terminal window
orb -u "${DOCKER_USER}:${DOCKER_PASS}" \
https://registry.example.com/v2/_catalog
Terminal window
orb -u admin:password \
-H "Accept: application/json" \
https://api.example.com/admin/status