diff --git a/templates/pep.js.j2 b/templates/pep.js.j2 index 1b88317..2638506 100644 --- a/templates/pep.js.j2 +++ b/templates/pep.js.j2 @@ -17,6 +17,7 @@ function enforce(r) { {% if nginx_pep_debug_enabled %} log(context, "Inside NJS enforce for " + r.method + " @ " + r.headersIn.host + "/" + r.uri) +log(context, "Remote user header " + r.headersIn.remote_user) {% endif %} if(context.request.args.token){ @@ -49,6 +50,8 @@ log(context, "Inside NJS enforce for " + r.method + " @ " + r.headersIn.host + " return context }).catch(e => { context.request.error("error .... " + njs.dump(e)); context.request.return(401)} ) return + } else if (context.request.headersIn.remote_user){ + context.request.internalRedirect(context.backend) } context = computeProtection(context)