Authz OK when remote_user is already set.

This commit is contained in:
Andrea Dell'Amico 2021-11-04 16:51:46 +01:00
parent 0063f602c9
commit 798c6bedb8
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 3 additions and 0 deletions

View File

@ -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)