Forum Discussion

AlexS_yb's avatar
AlexS_yb
Icon for Cirrocumulus rankCirrocumulus
Aug 28, 2021

APM variable assignment

Hi

 

I am using client certificate crldp to authorise people.

What I want to do is extract the email from the subject and assign it to

session.logon.last.username

 

This is what I have come up with - with some googling. not sure if its the best approach

 

expr { [lindex [regexp -inline {emailAddress=([^, \\\r]*)} [mcget session.ssl.cert.subject]] 1] }

 

 

I think if I could use findstr or substr it would be better but I can't seem to call those functions - looks like they are irule and not tcl.

 

I'm guessing - i found string trim, i could use that but I couldn't get it to work I think because the 2nd arg is char not string !

 

so then i found string range

 

so maybe

string range [mcget session.ssl.cert.subject] <> end

 

not sure what to put in <> to find the position of the string

 

again back to string trim

https://devcentral.f5.com/s/articles/irules-101-14-tcl-string-commands-part-2

has an example that makes it look like the second parameter takes a string.

 

 

 

 

 

 

 

No RepliesBe the first to reply