Forum Discussion
Amit_Grover_171
Nimbostratus
Oct 12, 2015Need to write Irule to decode auth string to Base64 and fetch domain name from it and compare that domain name with certificate to deny/permit traffic
Hi,
Need to write Irule to decode auth string to Base64 and fetch domain name from it and compare that domain name with certificate to deny/permit traffic.
Please help ASAP.
/Regards
A...
Kevin_Stewart
Employee
Oct 12, 2015Try this:
when HTTP_REQUEST {
if { [HTTP::header exists Authorization] } {
catch {
set creds [b64decode [findstr [HTTP::header Authorization] "Basic " 6]]
credentials will ether be in domain\user:password or user@domain:password format
if { $creds contains "\\" } {
set domain [findstr $creds "" 0 "\\"]
} elseif { $creds contains "@" } {
set domain [findstr $creds "@" 1 ":"]
}
log local0. $domain
}
}
}
Once you have the domain value you can simply apply logic to compare it to the certificate:
if { $domain ne "" } {
if { $domain eq $cert_valu } {
...do something
}
}
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