Forum Discussion
Baddogsettle_16
Nimbostratus
Mar 26, 2015iRule to replace NetBIOS-Name with sAMAccountName
All,
I have an iOS app (qlikview 2.1) that is sometimes sending the NetBIOS-Name rather than the sAMAccountName. I am trying to create an iRule to check for this and do a replacement. I am recei...
Michael_Jenkins
Cirrostratus
Mar 26, 2015According to the wiki page for HTTP::username, it's a read-only command, so you can't update the username with that command. Here's spin off of what I've done in the past that may work for you:
when HTTP_REQUEST {
if { [HTTP::header exists "Authorization"] && [HTTP::header value "Authorization"] starts_with "Basic " } {
Basic Authentication
log local0. " Authorization: [HTTP::header value "Authorization"]"
log local0. " Username: [HTTP::username]"
log local0. " Password: [HTTP::password]"
Parse the username
set user [getfield [string tolower [HTTP::username]] "\" 2]
Recreate the Authorization header
set newAuth "${user}:[HTTP::password]"
set newAuthEnc [b64encode $newAuth]
HTTP::header replace "Authorization" "Basic $newAuthEnc"
Remove the variables
unset newAuth
unset newAuthEnc
unset user
}
}
NOTE: I saw you were using
"/" in your getfield command. Was that intentional or did you mean to user "\" which is used for domain\username notation?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