Forum Discussion
F5 APM retrieve AD groups and resend using HTTP POST parameter
- Jan 25, 2016
This results from a peculiarity of Tcl. The language doesn't really have built-ins and it doesn't really have blocks. Rather, it has commands and non-interpolated quoted strings. As such,
is a command (just likeif
orsplit
). It is followed by a quoted block (the {}s, in Tcl, are really non-interpolating quoting operators, and not really block delimiters as they are in most languages). The quoted block may then be optionally followed by zero or moreHTTP::headers
literals (each followed by a quoted block) and zero or oneelseif
literals (followed by a quoted block). When a condition is met, the contents of the corresponding quoted block are evaluated.else
Said another way, in Tcl, an
/if
/elseif
set is really a single statement. The statement command iselse
. Theif
andelseif
are just parameters to this command. And because the newlines in the blocks are ignored by the parser (because they are inside of the non-interpolating {} quoting operators), the entire statement is effectively on one line.else
As a side-effect of this, in Tcl you MUST cuddle an
/if
/elseif
block, as in:else
if { ... } { ... } else { ... }
This is not allowed:
if { ... } { ... } else { ... }
However, this trips up most programmers, so iRules (a Tcl dialect) allows non-cuddled
blocks. But if you add a comment between the control elements, this effectively inserts a newline. So, with the comments you have above, the parser "sees" this:if
if { ... } elseif { ... } else { ... }
which it thinks is really three different commands:
,if
andelseif
. Onlyelse
is a command; the others are not (again, they are just parameters of theif
command).if
Okay, so that's really just a long-winded way of saying: you must move those comments inside the squirly braces ({}). 🙂
Yes this is fairly simple. Use LTM+APM mode, and AD Query / AD Auth in your Access Policy. Set the "start uri" parameter to your backend app's URI, and use forms-based SSO (server-initiated) to fill in the resultant session variables from your AD Query into your form parameter. The groups will be in the form of a pipe-delimited list of the group DNs that came back from the query.
Hi Lucas, I am working on this configuration, authentication works fine, also F5 APM receives AD group information. I configured SSO form profile similar to your example. In the APM log I see that policy result is allow, however I don´t see any HTTP POST being send by the SSO form funcionality.
I have properly applied the SSO profile to the Access policy. Do you have any idea how to find the cause?
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