gurl auth
gurl auth
List the built-in auth handlers and the parameters each one accepts, so you know what to pass to --auth and --auth-param on gurl save and gurl edit.
Synopsis
gurl auth list
gurl auth info <type>gurl run applies the auth saved on the request. Auth params may contain placeholders (token='{{API_KEY}}'); they are filled during request resolution, then the handler updates the outgoing request. Literal secret auth params are masked by show, list --json, codegen and paste.
| Type | Use it for |
|---|---|
basic | HTTP Basic auth with username and password |
bearer | Bearer tokens in the Authorization header |
apikey | API key in a header or query parameter |
oauth1 | OAuth 1.0 signed requests |
oauth2 | OAuth 2.0 auth_code or client credentials flow |
awsv4 | AWS SigV4 request signing |
digest | Digest Authorization headers from supplied challenge values |
ntlm | NTLM negotiate or challenge response headers |
Subcommands
list
List the built-in auth types.
gurl auth listNone.
info
Show the parameters for one auth type, marked required/optional and secret, with defaults.
gurl auth info <type>None.
Examples
See what a handler needs
gurl auth info bearerAuth type: bearer
Parameters:
token required,secret Bearer token valueSave bearer auth that reads a secret from the environment
gurl save "profile" '{{BASE_URL}}/me' \
--auth bearer \
--auth-param token='{{API_KEY}}'
gurl run "profile" --env prodOAuth 2 client credentials
gurl save "service-token" https://api.example.com/service \
--auth oauth2 \
--auth-param flow=client_credentials \
--auth-param client_id='{{client_id}}' \
--auth-param client_secret='{{client_secret}}' \
--auth-param token_url='https://auth.example.com/oauth/token' \
--auth-param scope='read:orders'To change or clear saved auth, use gurl edit <name> --auth ... or gurl edit <name> --auth none.
Related commands
gurl save- Save auth with a requestgurl edit- Update or clear saved authgurl run- Execute a request with saved auth- Credential storage - Where auth params are stored