From 6ce4636dc1c4cdb232069cc4e52f9088f064633f Mon Sep 17 00:00:00 2001 From: Vishnu Mohan Date: Sun, 8 Jul 2018 16:40:16 -0400 Subject: [PATCH] Fix to use upn after copy-paste from email section --- nginx/lua/oidc_auth_proxy_pass.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/lua/oidc_auth_proxy_pass.lua b/nginx/lua/oidc_auth_proxy_pass.lua index 21de26f..bb3a230 100644 --- a/nginx/lua/oidc_auth_proxy_pass.lua +++ b/nginx/lua/oidc_auth_proxy_pass.lua @@ -109,7 +109,7 @@ end -- Only authorize a valid user, based on their User Principal Name (UPN), if specified if is_not_empty(os.getenv("OIDC_UPN")) then ngx.log(ngx.DEBUG, "Authorizing UPN: " .. os.getenv("OIDC_UPN") .. " against " .. tostring(res.user.upn)) - if res.user.email ~= os.getenv("OIDC_UPN") then + if res.user.upn ~= os.getenv("OIDC_UPN") then ngx.exit(ngx.HTTP_FORBIDDEN) end end