-
|
opa-envoy-plugin extends OPA with a gRPC server, and it always returns 403 for all denied requests. But opa can be used for both authentication and authorization, I want to return 401 when authentication is failed, is the opa-envoy-plugin able to do that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
The policy primer docs for envoy have an example of an object response. I would think that you can make use of that, see this sketch: package envoy.authz
default response = {
"allowed": false,
"body": "Unauthorized Request",
"http_status": 403
}
response = r {
not is_authenticated
r := {
"allowed": false,
"http_status": 401
}
}where Note that the query path for this example is |
Beta Was this translation helpful? Give feedback.
The policy primer docs for envoy have an example of an object response. I would think that you can make use of that, see this sketch:
where
is_authenticatedis the rule in which you establish authentication.Note that the query path for this example is
envoy/authz/response-- I've always foundallowfor an object response slightly off the mark.