linshare
linshare copied to clipboard
How to block the [email protected] account on the ui user
Hello, I'm using linshare V5.1.2. I need that [email protected] is only available for the admin panel. So how can I block it to avoid any authentication on the ui user ?
I use filter on an haproxy
# reverse base64 current auth
http-request set-var(req.auth_old) req.fhdr(Authorization),regsub(^Basic\s+,,i),b64dec
# extract old user
http-request set-var(req.auth_old_user) var(req.auth_old),regsub(:.+,)
# acl underscore_found
acl underscore_found var(req.auth_old_user) -m sub localhost.localdomain
# prepare new username and password
http-request set-var(req.auth_user) var(req.auth_old_user),regsub(localhost,customerABC_) if underscore_found
http-request set-var(req.auth_pass) var(req.auth_old),regsub(.+:,) if underscore_found
# concat and base64 encode
http-request set-var(req.auth_new) var(req.auth_user),concat(':',req.auth_pass,),base64 if underscore_found
# set Authorization header
http-request set-header Authorization %[str(),concat('Basic ',req.auth_new)] if underscore_found