spacewander commented on a change in pull request #6485:
URL: https://github.com/apache/apisix/pull/6485#discussion_r820381123



##########
File path: apisix/plugins/authz-keycloak.lua
##########
@@ -592,9 +593,17 @@ local function evaluate_permissions(conf, ctx, token)
         permission = conf.permissions
     end
 
-    -- Return 403 if permission is empty and enforcement mode is "ENFORCING".
+    -- Return 403 or 302 if permission is empty and enforcement mode is 
"ENFORCING".
     if #permission == 0 and conf.policy_enforcement_mode == "ENFORCING" then
         -- Return Keycloak-style message for consistency.
+        if conf.access_denied_redirect_uri then
+            core.response.set_header("Location", 
conf.access_denied_redirect_uri)
+            if ctx.var.request_method == "POST" then
+                return 307
+            else
+                return 302

Review comment:
       Would be better to use 307 in all cases?

##########
File path: apisix/plugins/authz-keycloak.lua
##########
@@ -592,9 +593,17 @@ local function evaluate_permissions(conf, ctx, token)
         permission = conf.permissions
     end
 
-    -- Return 403 if permission is empty and enforcement mode is "ENFORCING".
+    -- Return 403 or 302 if permission is empty and enforcement mode is 
"ENFORCING".

Review comment:
       Need to update




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to