Authz OK when remote_user is already set.
This commit is contained in:
parent
0063f602c9
commit
798c6bedb8
|
@ -17,6 +17,7 @@ function enforce(r) {
|
||||||
|
|
||||||
{% if nginx_pep_debug_enabled %}
|
{% if nginx_pep_debug_enabled %}
|
||||||
log(context, "Inside NJS enforce for " + r.method + " @ " + r.headersIn.host + "/" + r.uri)
|
log(context, "Inside NJS enforce for " + r.method + " @ " + r.headersIn.host + "/" + r.uri)
|
||||||
|
log(context, "Remote user header " + r.headersIn.remote_user)
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
if(context.request.args.token){
|
if(context.request.args.token){
|
||||||
|
@ -49,6 +50,8 @@ log(context, "Inside NJS enforce for " + r.method + " @ " + r.headersIn.host + "
|
||||||
return context
|
return context
|
||||||
}).catch(e => { context.request.error("error .... " + njs.dump(e)); context.request.return(401)} )
|
}).catch(e => { context.request.error("error .... " + njs.dump(e)); context.request.return(401)} )
|
||||||
return
|
return
|
||||||
|
} else if (context.request.headersIn.remote_user){
|
||||||
|
context.request.internalRedirect(context.backend)
|
||||||
}
|
}
|
||||||
|
|
||||||
context = computeProtection(context)
|
context = computeProtection(context)
|
||||||
|
|
Loading…
Reference in New Issue