Forum Discussion
Irule to block specific users from login to back office system
- Mar 27, 2019
To get username, use this command
set username [URI::query ?[HTTP::payload]] username]
It seems like the error is in your username assignment. It doesn't seem to be getting the username properly, at least when I tested it. I wrote this segment of code to grab the value of whatever comes after 'username=' in a urlencoded post.
log local0. "Payload: [HTTP::payload]"
set payload [string range [HTTP::payload] [string first username [HTTP::payload]] [string length [HTTP::payload]]]
set findex [string first = $payload]
set lindex [string first & $payload]
if {$lindex eq -1}
{
set lindex [string length $payload]
incr lindex
}
log local0. "Modified Payload: $payload"
set username [string range $payload [incr findex 1] [incr lindex -1]]I added in some error handling in case the username value was in different places in the payload. Hopefully, this will solve your problem if you replace your username variable assignment with it.
If you have any more questions, I am sure I can help.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
