Skip to content

Commit

Permalink
[TMA-630][haoliu & llr] Debug for Env of OKTA_BASE_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexuscream committed Feb 26, 2019
1 parent f7d31a8 commit 227b8f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions kong/plugins/okta-auth/okta_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ end
local function fetch_objc_label(oidc_id)
ngx.log(ngx.INFO, "fetch_objc_label :oidc id ", oidc_id)

local url = os.getenv('OKTA_BASE_URL') .. '/api/v1/apps/' .. oidc_id
local base_url = os.getenv('OKTA_BASE_URL')
ngx.log(ngx.DEBUG, "Get Env of base url ", base_url)

local url = base_url .. '/api/v1/apps/' .. oidc_id
local headers = get_Oidc_headers()
local status_code, response_body, response_headers = send_request(
local pok, status_code, response_body, response_headers = pcall(send_request(
url, "GET", headers, body_params
)
))

if status_code ~= 200 or not response_body then
if not pok or status_code ~= 200 or not response_body then
ngx.log(ngx.ERR, "Assemble OIDC Label failed with :status_code ", status_code)
return nil
end
Expand Down

0 comments on commit 227b8f8

Please sign in to comment.