Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kong-oidc-1.4.0-7.rockspec → kong-oidc-1.4.0-8.rockspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package = "kong-oidc"
version = "1.4.0-7"
version = "1.4.0-8"
source = {
url = "git://github.com/cloudbeds/kong-oidc",
tag = "1.4.0-7",
tag = "1.4.0-8",
dir = "kong-oidc"
}
description = {
Expand Down
8 changes: 7 additions & 1 deletion kong/plugins/oidc/handler.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local OidcHandler = {
VERSION = "1.3.0",
VERSION = "1.4.0",
PRIORITY = 1000,
}
local utils = require("kong.plugins.oidc.utils")
Expand Down Expand Up @@ -42,6 +42,9 @@ function handle(oidcConfig)
utils.injectUser(response, oidcConfig.userinfo_header_name)
end
return
elseif utils.has_bearer_access_token() then
ngx.log(ngx.ERR, "OidcHandler bearer JWT verification failed, returning 401")
return kong.response.error(ngx.HTTP_UNAUTHORIZED, "Invalid bearer token")
end
end

Expand All @@ -54,6 +57,9 @@ function handle(oidcConfig)
if not oidcConfig.disable_userinfo_header then
utils.injectUser(response, oidcConfig.userinfo_header_name)
end
elseif utils.has_bearer_access_token() then
ngx.log(ngx.ERR, "OidcHandler introspection failed for bearer token, returning 401")
return kong.response.error(ngx.HTTP_UNAUTHORIZED, "Invalid bearer token")
end
end

Expand Down
Loading