github.com/avenga/couper@v1.12.2/server/testdata/oauth2/14_couper.hcl (about)

     1  server "oauth-client" {
     2    api {
     3      endpoint "/rs1" {
     4        proxy {
     5          backend = "rs1"
     6        }
     7      }
     8      endpoint "/rs2" {
     9        proxy {
    10          backend = "rs2"
    11        }
    12      }
    13    }
    14  }
    15  
    16  definitions {
    17    # backends for resource server
    18    # with referenced backend
    19    backend "rs1" {
    20      origin = "{{.rsOrigin}}"
    21      oauth2 {
    22        token_endpoint = "{{.asOrigin}}/token"
    23        backend        = "token"
    24        client_id      = "foo"
    25        client_secret  = "etbinbp4in"
    26        grant_type     = "client_credentials"
    27      }
    28    }
    29    # with inline backend
    30    backend "rs2" {
    31      origin = "{{.rsOrigin}}"
    32      oauth2 {
    33        token_endpoint = "{{.asOrigin}}/token"
    34        backend {
    35          origin = "{{.asOrigin}}"
    36          add_request_headers = {
    37            x-sub = "myself"
    38          }
    39        }
    40        client_id     = "foo"
    41        client_secret = "etbinbp4in"
    42        grant_type    = "client_credentials"
    43      }
    44    }
    45  
    46    backend "token" {
    47      origin = "{{.asOrigin}}"
    48      add_request_headers = {
    49        x-sub = "myself"
    50      }
    51    }
    52  
    53  }
    54  
    55  settings {
    56    no_proxy_from_env = true
    57  }