Forum Discussion
smilanko_261688
Cirrus
Jul 07, 2016Attempting to incorporate IRule basic auth with an access policy
Here is my scenario:
Some webservice clients might hit a particular url. For the purpose of this question, lets say that is www.example.com/webserviceOne/one
When they hit this, Basic Authenticat...
smilanko_261688
Cirrus
Jul 07, 2016I solved my problem by using
when ACCESS_SESSION_STARTED
instead of
when HTTP_REQUEST
My IRule looks like this:
when ACCESS_SESSION_STARTED {
if {[HTTP::username] eq "" || [HTTP::password] eq ""} {
ACCESS::respond 401 WWW-Authenticate "Basic realm=\"EXAMPLE\""
return
} else {
ACCESS::session data set "session.logon.last.username" [HTTP::username]
ACCESS::session data set "session.logon.last.password" [HTTP::password]
}
}
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