Authentication
Orb supports multiple authentication methods for HTTP requests.
Basic Authentication
Section titled “Basic Authentication”Use -u or --user with the format username:password:
orb -u alice:secret123 https://api.example.com/protectedThis sends an Authorization: Basic <base64> header where <base64> is the Base64-encoded username:password string.
Password Prompt
Section titled “Password Prompt”If you omit the password, orb will use an empty password:
# Empty passwordorb -u alice: https://api.example.com/protectedExample with Environment Variable
Section titled “Example with Environment Variable”orb -u "alice:${API_PASSWORD}" https://api.example.com/protectedBearer Token Authentication
Section titled “Bearer Token Authentication”Use --bearer to send a bearer token:
orb --bearer "eyJhbGciOiJIUzI1NiIs..." https://api.example.com/protectedThis sends an Authorization: Bearer <token> header.
Common Use Cases
Section titled “Common Use Cases”# OAuth2 access tokenorb --bearer "${ACCESS_TOKEN}" https://api.example.com/me
# JWT tokenorb --bearer "$(cat token.txt)" https://api.example.com/protected
# API key as bearer tokenorb --bearer "${API_KEY}" https://api.example.com/dataCustom Authorization Headers
Section titled “Custom Authorization Headers”For other authentication schemes, use the -H flag:
# API Key in headerorb -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 Signatureorb -H "Authorization: AWS4-HMAC-SHA256 ..." https://api.example.comAuthentication with Client Certificates (mTLS)
Section titled “Authentication with Client Certificates (mTLS)”For mutual TLS authentication, use --cert and optionally --key:
orb --cert client.pem --key client-key.pem https://secure.example.comSee TLS & SSL for detailed certificate configuration.
Combining Authentication Methods
Section titled “Combining Authentication Methods”You can combine other auth methods:
# Bearer token + API key headerorb --bearer "${TOKEN}" \ -H "X-API-Key: ${API_KEY}" \ https://api.example.com
# Basic auth + client certificateorb -u alice:password \ --cert client.pem \ https://secure.example.comAuthentication Examples
Section titled “Authentication Examples”REST API with Bearer Token
Section titled “REST API with Bearer Token”# Get user profileorb --bearer "${TOKEN}" https://api.github.com/user
# Create a resourceorb --bearer "${TOKEN}" \ -X POST \ --json '{"name": "New Resource"}' \ https://api.example.com/resourcesPrivate Docker Registry
Section titled “Private Docker Registry”orb -u "${DOCKER_USER}:${DOCKER_PASS}" \ https://registry.example.com/v2/_catalogBasic Auth with JSON Response
Section titled “Basic Auth with JSON Response”orb -u admin:password \ -H "Accept: application/json" \ https://api.example.com/admin/status