Authentication

Authentication provides shortcuts for common HTTP authentication schemes. It populates the authentication field of a recipe. There are multiple source types, and the type is specified using YAML's tag syntax.

Variants

VariantTypeValue
!basicBasic AuthenticationBasic authentication credentials
!bearerstringBearer token

Basic Authentication

Basic authentication contains a username and optional password.

FieldTypeDescriptionDefault
usernamestringUsernameRequired
passwordstringPassword""

Examples

# Basic auth
requests:
  create_fish: !request
    method: POST
    url: "{{host}}/fishes"
    body: !json { "kind": "barracuda", "name": "Jimmy" }
    authentication: !basic
      username: user
      password: pass
---
# Bearer token auth
chains:
  token:
    source: !file
      path: ./token.txt
requests:
  create_fish: !request
    method: POST
    url: "{{host}}/fishes"
    body: !json { "kind": "barracuda", "name": "Jimmy" }
    authentication: !bearer "{{chains.token}}"