Open iam-nagarajan opened 8 months ago
text/plain is the default. You can set the content_type for custom error responses on either a Module or a Mapping. I'm not sure if that spec is available on the AuthService but it might be something to try.
In order to send any header from the server behind AuthService
back to the clients, the headers need to be added to allowed_authorization_headers
:
allowed_authorization_headers:
- X-Blocked
- Content-Type
This conflicts with the Emissary's documentation:
The entire HTTP response from the ExtAuth service--including the status code, the headers, and the body--is handed back to the client verbatim.
Content-Type from Auth service is overwritten in error response
To Reproduce Setup AuthService
The mockserver is configured to authenticate the requests and for invalid requests it'll send the response body like below with 403 status code and Content-Type set as application/json
When we call the API through emissary, it overrides the Content-Type as text/plain from application/json
Expected behavior The auth failure response should retain original Content-Type
Versions (please complete the following information):