Forum Discussion
irule help
Hi,
In such case, I request AD server with UPN and retrieve AD sAMAccountName.
First, replace this irule to a variable assign like in this link. the following code extract without the irule event.
set extension [string tolower [mcget {session.ssl.cert.x509extension}]];
return [string range $extension [expr {[string first "othername:ups<" $extension] +14}] [expr {[string last ">" $extension] -1}] ]; after this, add a AD query box with Filter:
(userPrincipalName=%{session.logon.last.upn})then sAMAccountName is store in session.ad.last.attr.sAMAccountName. you can copy it in session.logon.last.username with a new variable assign box with expression.
expr {[mcget {session.ad.last.attr.sAMAccountName}]}don't forget to create 2 variables:
- session.logon.last.username
- session.logon.last.logonname (used in active session or event logs)
Note: Variable assign code change. there was an issue with string first searching for an uppercase string in a lowercase converted string.
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