Search code examples
jwtenvoyproxy

Custom status code when jwt validation fails


I was wondering if there is a way to specify a custom status code to be returned when the jwt validation fails in envoy.filters.http.jwt_authn. Normally this returns a 401 status code but I would like to change it to a custom status code like 443.

I would like to do this because I need a way to somehow, in my client, differentiate between the 401 that envoy could return and the 401 that the server behind envoy may return. I hope I made myself clear.


Solution

  • Local reply modification can modify the response by Envoy itself. Please try the configuration if it can meet your requirement.