You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by me...@apache.org on 2020/06/24 01:19:25 UTC

[incubator-apisix] branch master updated: bugfix: Fix for remote open ID connect introspection (#1743)

This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 78ab35d  bugfix: Fix for remote open ID connect introspection (#1743)
78ab35d is described below

commit 78ab35db29c0f8e536a552eb907bffc33a185285
Author: Nirojan Selvanathan <ss...@gmail.com>
AuthorDate: Wed Jun 24 03:19:13 2020 +0200

    bugfix: Fix for remote open ID connect introspection (#1743)
    
    fix #1741
---
 apisix/plugins/openid-connect.lua | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/apisix/plugins/openid-connect.lua b/apisix/plugins/openid-connect.lua
index 6a93226..2572c85 100644
--- a/apisix/plugins/openid-connect.lua
+++ b/apisix/plugins/openid-connect.lua
@@ -116,11 +116,12 @@ local function introspect(ctx, conf)
             end
         else
             res, err = openidc.introspect(conf)
-            if res then
+            if err then
+                return ngx.HTTP_UNAUTHORIZED, err
+            else
                 return res
             end
         end
-
         if conf.bearer_only then
             ngx.header["WWW-Authenticate"] = 'Bearer realm="' .. conf.realm
                                              .. '",error="' .. err .. '"'