Couper Documentation

edge

Token Request (Beta)

The beta_token_request block in the Backend Block context configures a request to get a token used to authorize backend requests.

Block nameContextLabel
beta_token_requestBackend Blockâš  A Token Request (Beta) Block w/o a label has an implicit label "default". Only one Token Request (Beta) Block w/ label "default" per Backend Block is allowed.

Attributes

NameTypeDefaultDescription
backend
string
-

References a backend in definitions for the token request. Mutually exclusive with backend block.

body
string
-

Creates implicit default Content-Type: text/plain header field.

expected_status
tuple (int)
[]

If defined, the response status code will be verified against this list of status codes, If the status code is unexpected a beta_backend_token_request error can be handled with an error_handler.

form_body
string
-

Creates implicit default Content-Type: application/x-www-form-urlencoded header field.

headers
object
-

Sets the given request HTTP header fields.

json_body
null, bool, number, string, object, tuple
-

Creates implicit default Content-Type: application/json header field.

method
string
"GET"

The request method.

query_params
object
-

Sets the URL query parameters.

token
string
-

The token to be stored in backends.<backend_name>.tokens.<token_request_name>.

ttl
string
-

The time span for which the token is to be stored.

url
string
-

URL of the resource to request the token from. May be relative to an origin specified in a referenced or nested backend block.

If the url attribute is specified and its value is an absolute URL, the protocol and host parts must be the same as in the value of the {origin} attribute of the used backend.

Nested Blocks

NameDescription
backend

Configures a backend for the token request (zero or one). Mutually exclusive with backend attribute.