Forum Discussion
augustusk
Nimbostratus
Dec 01, 2015APM iRule Event
I need some assistance on why I get no value for the client certificate CN when running below iRule. The variable $user gets a value but $cn does not :-(. I have looked in /var/log/ltm and nothing. T...
Stanislas_Piro2
Cumulonimbus
May 09, 2016Hi,
you can evaluate tcl in variable assign instead of irule event. most of tcl commands are implemented in variable assign but some tcl command are not yet. add a ; at the end of every commands as APM remove new lines.
to extract UPN from certificate, create a variable assign with expression:
session.logon.last.certupn =
set extension [string tolower [mcget {session.ssl.cert.x509extension}]];
return [string range $extension [expr {[string first "othername:UPN<" $extension] +14}] [expr {[string last ">" $extension] -1}] ];
if you want to create a variable which compare both strings:
session.custom.query_result =
if { [mcget {session.logon.last.certupn}] contains [string tolower [mcget {session.logon.last.username}]]} { return 0 } else { return 1}
or create a branch with expression:
expr { [mcget {session.logon.last.certupn}] contains [string tolower [mcget {session.logon.last.username}]] }
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