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
Variant | Type | Value |
---|---|---|
!basic | Basic Authentication | Basic authentication credentials |
!bearer | string | Bearer token |
Basic Authentication
Basic authentication contains a username and optional password.
Field | Type | Description | Default |
---|---|---|---|
username | string | Username | Required |
password | string | Password | "" |
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}}"