From 80b472fdf7e413de840abbe52fc885cdf254e23b Mon Sep 17 00:00:00 2001 From: haoliu Date: Tue, 26 Feb 2019 14:37:34 +0800 Subject: [PATCH] [TMA-630][haoliu & llr] Log for response_body --- kong/plugins/okta-auth/handler.lua | 2 +- kong/plugins/okta-auth/okta_api.lua | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kong/plugins/okta-auth/handler.lua b/kong/plugins/okta-auth/handler.lua index 89e0026..d32123c 100644 --- a/kong/plugins/okta-auth/handler.lua +++ b/kong/plugins/okta-auth/handler.lua @@ -37,7 +37,7 @@ local OktaAuth = BasePlugin:extend() OktaAuth.PRIORITY = 1000 function OktaAuth:init_worker() - OktaAuth.super.new(self, "okta-auth") + OktaAuth.super.init_worker(self, "okta-auth") --constant.load_env_when_nginx_worker_init() end diff --git a/kong/plugins/okta-auth/okta_api.lua b/kong/plugins/okta-auth/okta_api.lua index 8dc2277..043d0cd 100644 --- a/kong/plugins/okta-auth/okta_api.lua +++ b/kong/plugins/okta-auth/okta_api.lua @@ -70,6 +70,13 @@ local function fetch_objc_label(oidc_id) return nil end + ngx.log(ngx.DEBUG, "Get Response Success response_body: ", response_body) + if type(response_body) == "table" then + for key, value in pairs(response_body) do + print(key, value) + end + end + local oidc = response_body[1] or response_body return oidc.label end