Forum Discussion
Jeff_Knights_44
Nimbostratus
Dec 06, 2012local HTTP auth looping? HELP!!!
I recently built a simple irule to do a local HTTP authentication from a datagroup which would block the public from seeing a beta website.
I have watched the logs and it says "User XXX has been authorized to access virtual server /Common/TEST_SERVER
so it seems the irule is working correctly but the website never comes up, the userid and password screen keep coming up as if in a loop. any suggestions?
here is the irule:
when HTTP_REQUEST {
binary scan [ md5 [HTTP::password]] H* password
if { [class lookup "[HTTP::username]" datagroup_xxx] equals $password } {
log local0. "User [HTTP::username] has been authorized to access virtual server [virtual name]"
Insert iRule-based application code here if necessary
} else {
if { [string length [HTTP::password]] != 0 } {
log local0. "User [HTTP::username] has been denied access to virtual server "
}
HTTP::respond 401 WWW-Authenticate "Basic realm=\"local.loc\""
}
}
12 Replies
- hoolio
Cirrostratus
Hi Jeff,
Can you try this?when HTTP_REQUEST { if {[HTTP::password] eq ""}{ HTTP::respond 401 WWW-Authenticate "Basic realm=\"local.loc\"" } else { binary scan [md5 [HTTP::password]] H* password if { [class lookup "[HTTP::username]" datagroup_xxx] equals $password } { log local0. "User [HTTP::username] has been authorized to access virtual server [virtual name]" Insert iRule-based application code here if necessary } else { HTTP::respond 403 content "blocked!" } } }
Aaron - Jeff_Knights_44
Nimbostratus
it came back with:
The website declined to show this webpage - Jeff_Knights_44
Nimbostratus
and the F5 logs showed:
User XXX has been authorized to access virtual server /Common/XXXXXXXXXX - hoolio
Cirrostratus
If you take the iRule off of the virtual server are you able to access the pool?
Aaron - Jeff_Knights_44
Nimbostratus
i just noticed something, the second time the userid/password auth screen comes back is says something about "Sling (Development)" which is not us. - Jeff_Knights_44
Nimbostratus
yes, if you take the irule off it goes where it should... one of our websites - Jeff_Knights_44
Nimbostratus
can you see an attachment i just attached ? - Jeff_Knights_44
Nimbostratus
can you see this attachment?
server.jpg
- Jeff_Knights_44
Nimbostratus
ok, one more time...
- Jeff_Knights_44
Nimbostratus
I am quickly thinking everything is working as it should but the website sees the AUTH request and somehow the JAVA on the site is reacting...
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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