External authorization check for forward-auth and Envoy ext_authz
curl --request POST \
--url https://api.example.com/api/identity/ext-authz \
--header 'Authorization-PSK: <api-key>'import requests
url = "https://api.example.com/api/identity/ext-authz"
headers = {"Authorization-PSK": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Authorization-PSK': '<api-key>'}};
fetch('https://api.example.com/api/identity/ext-authz', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/identity/ext-authz",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization-PSK: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/identity/ext-authz"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization-PSK", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/identity/ext-authz")
.header("Authorization-PSK", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/identity/ext-authz")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization-PSK"] = '<api-key>'
response = http.request(request)
puts response.read_bodyIdentity
External authorization check for forward-auth and Envoy ext_authz
Forward-auth endpoint for an Envoy/nginx ext_authz filter.
Checks your Authorization-PSK header and injects x-authz-* and x-auth-method identity
headers for the proxy if valid. Bearer-only requests aren’t handled here.
Depending on your PSK, one of three things happens:
- Valid user PSK: Returns 200 with
x-authz-*andx-auth-methodidentity headers injected. - Invalid PSK or the shared general PSK: Returns 403. The shared general PSK carries no real identity,
so the API blocks it to prevent passing a fixed
pskuser to upstream services. - No PSK: Returns 200 with no
x-authz-*identity headers. JWT takes over.
POST
/
api
/
identity
/
ext-authz
External authorization check for forward-auth and Envoy ext_authz
curl --request POST \
--url https://api.example.com/api/identity/ext-authz \
--header 'Authorization-PSK: <api-key>'import requests
url = "https://api.example.com/api/identity/ext-authz"
headers = {"Authorization-PSK": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Authorization-PSK': '<api-key>'}};
fetch('https://api.example.com/api/identity/ext-authz', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/identity/ext-authz",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization-PSK: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/identity/ext-authz"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization-PSK", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/identity/ext-authz")
.header("Authorization-PSK", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/identity/ext-authz")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization-PSK"] = '<api-key>'
response = http.request(request)
puts response.read_bodyAuthorizations
Response
Allowed. The API sets identity headers when a valid PSK is present.
Was this page helpful?

