Forum Discussion
ChristianH_1903
Nimbostratus
Nov 18, 2015Generating SAML attributes and calculations in variable assignments
Hi,
I'm currently setting up my f5 to act as SAML IdP. One of the attributes I need to send back is supposed to contain an opaque, privacy-preserving unique ID. I was thinking of using e.g. sha2...
Kevin_Stewart
Employee
Nov 18, 2015Do this:
-
Add an iRule event agent to the visual policy.
-
Add an iRule to the VIP:
when ACCESS_POLICY_AGENT_EVENT { ACCESS::session data set "session.user.MyPersistentNameID" [b64encode [sha256 [ACCESS::session data get "session.ad.last.attr.mail"]]] }
sha256 is going to produce a binary value, probably not exactly what you want, so base64-encoding that makes it at least portable. You could also actually hex-encode the sha256 output to produce a slightly more palatable hexadecimal product:
binary scan [sha256 [ACCESS::session data get "session.ad.last.attr.mail"]] H* encstr
ACCESS::session data set "session.user.MyPersistentNameID" $encstr
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