| 1 |
= Attribute References |
| 2 |
|
| 3 |
Attributes in a list may be referenced via one of the following two |
| 4 |
syntaxes: |
| 5 |
|
| 6 |
`%{Attribute-Name}` + |
| 7 |
`%{<list>:Attribute-Name}` |
| 8 |
|
| 9 |
The `<list>:` prefix is optional. If given, it must be a valid |
| 10 |
reference to an xref:list.adoc[attribute list]. |
| 11 |
|
| 12 |
If the `<list>:` prefix is omitted, then the `request` list is |
| 13 |
assumed. |
| 14 |
|
| 15 |
For EAP methods with tunneled authentication sessions (i.e. PEAP and |
| 16 |
EAP-TTLS), the inner tunnel session can refer to a list for the outer |
| 17 |
session by prefixing the list name with `outer.` ; for example, |
| 18 |
`outer.request`. |
| 19 |
|
| 20 |
When a reference is encountered, the given list is examined for an |
| 21 |
attribute of the given name. If found, the variable reference in the |
| 22 |
string is replaced with the value of that attribute. Otherwise, the |
| 23 |
reference is replacedd with an empty string. |
| 24 |
|
| 25 |
.Examples |
| 26 |
|
| 27 |
`%{User-Name}` + |
| 28 |
`%{request.User-Name} # same as above` + |
| 29 |
`%{reply.User-Name}` + |
| 30 |
`%{outer.request.User-Name} # from inside of a TTLS/PEAP tunnel` |
| 31 |
|
| 32 |
Examples of using references inside of a string: |
| 33 |
|
| 34 |
`"Hello %{User-Name}"` + |
| 35 |
`"You, %{User-Name} are not allowed to use %{NAS-IP-Address}"` |
| 36 |
|
| 37 |
== Additional Variations |
| 38 |
|
| 39 |
`%{Attribute-Name[#]}`:: |
| 40 |
Returns an integer containing the number of named attributes |
| 41 |
|
| 42 |
`%{Attribute-Name[0]}`:: |
| 43 |
|
| 44 |
When an attribute appears multiple times in a list, this syntax allows |
| 45 |
you to address the attributes as with array entries. `[0]` refers to |
| 46 |
the first attributes, `[1]` refers to the second attribute, etc. |
| 47 |
|
| 48 |
`%{Attribute-Name[*]}`:: |
| 49 |
|
| 50 |
Returns a comma-separated string containing all values for the named |
| 51 |
attributes. |
| 52 |
|
| 53 |
// Copyright (C) 2020 Network RADIUS SAS. Licenced under CC-by-NC 4.0. |
| 54 |
// Development of this documentation was sponsored by Network RADIUS SAS. |