Forum Discussion
U_franco_117956
Nimbostratus
Jan 20, 2015LTM as a proxy asking username/password
Hi. I´m involved to develop an irule in order to get LTM worked as a basic proxy server for vservers where irule was configured, asking for a username password in the same way you were being auth...
U_franco_117956
Nimbostratus
Jan 21, 2015Hi.
Thanks for your response.
I have solved my problem. I was asking for the wrong HTTP Header. I had to look for Authorization header, not Proxy-Authorization.
Finally this is my irule, and it works fine:
when HTTP_REQUEST {
if { not ([HTTP::header exists "Authorization"]) } {
HTTP::respond 401 WWW-Authenticate "BASIC realm=\"F5 BIGIP PROXY AUTH\""
} else {
set proxyauth [lindex [split [HTTP::header value "Authorization"] " "] 1]
set username [lindex [split [b64decode $proxyauth] ":"] 0 ]
set password [lindex [split [b64decode $proxyauth] ":"] 1 ]
log local0. "PROXY-AUTHORIZATION HEADER IS $proxyauth, USERNAME IS $username AND PASSWORD IS $password"
if {not ($username equals "useraaa" and $password equals "aaauser") } {
HTTP::respond 401 WWW-Authenticate "BASIC realm=\"F5 BIGIP PROXY AUTH\""
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects