<@U04UQ68083H> How should a request sent to oathke...
# ory-copilot
s
@chilly-king-10285 How should a request sent to oathkeeper decisions api look like?
b
A message from kapa.ai
To answer your question about how a request to the Oathkeeper Decision API should look like, I'll provide you with the relevant information from the knowledge sources. The Oathkeeper Decision API is designed to mirror the proxy capability of Oathkeeper's proxy functionality. Here's how a request to the Decision API should be structured: 1. The request should be sent to the
/decisions
endpoint on the Oathkeeper API port. 2. The API works with all HTTP methods (GET, POST, PUT, etc.) and matches every path prefixed with
/decisions
. 3. You need to include specific headers in your request to provide the necessary information: - `X-Forwarded-Method`: The HTTP method of the original request - `X-Forwarded-Proto`: The protocol (http or https) of the original request - `X-Forwarded-Host`: The host of the original request - `X-Forwarded-Uri`: The URI of the original request 4. If your access rule requires authentication, you should include the appropriate authentication header (e.g.,
Authorization
for bearer tokens). Here's an example of how a curl request to the Decision API might look:
Copy code
curl -H "X-Forwarded-Method: GET" \      -H "X-Forwarded-Proto: http" \      -H "X-Forwarded-Host: myhost" \      -H "X-Forwarded-Uri: /xyz" \      -H "Authorization: Bearer sometoken" \      -X GET <http://oathkeeper-api:4456/decisions> -v
The Decision API will then return one of the following status codes: - 200 (request should be allowed) - 401 (unauthorized) - 403 (forbidden) This allows you to integrate Oathkeeper with other API Proxies like Ambassador, Kong, Envoy, and others. [Oathkeeper API Reference](https://www.ory.sh/docs/oathkeeper/reference/api) [Oathkeeper Introduction](https://www.ory.sh/docs/oathkeeper#operating-modes) Remember that the specific headers and authentication methods required may vary depending on your Oathkeeper configuration and access rules.