Attribute Functions
Definition
Attribute Functions allow you to evaluate and manipulate attributes to be sent to applications through a Federation.
Attribute Functions reference built-in functions and are declared in the Memority ADM portal.
Attribute Functions can then be used in a Federation configuration in the USR portal.
Built-in Attribute Functions
The following built-in functions are available :
Name | Input | Output | Description | Example |
---|---|---|---|---|
valueOf() | Takes the attribute name as argument. |
| Returns the value of an attribute name. |
|
concat() | Takes a variable number of either :
|
| Concatenate the passed arguments as a String. Only mono-valued attributes can be used with this function. Multi-valued attributes are not supported. |
|
hasRight() | Can take as arguments (using attribute names or string literals):
|
| Test whether the processed Identity has been granted a certain right. When used to provide a claim value, it returns "true" or "false". |
|
rightTargets() | Only takes the right name as argument (can be an attribute name or a string literal). |
| Retrieve the targets of a granted right. |
|
rightPrivileges() | Takes 2 arguments (can be attribute names or string literals):
|
| Retrieve the privileges of a granted right on a certain target. |
|
valueIfAuthLevel() | Takes 2 arguments :
The authentication level is provided as a string. |
| Returns the value of the given attribute only if the user is authenticated with a level >= to the given authentication level. |
|
valueIfRight() | Can take as arguments (using attribute names or string literals):
|
| Returns the value of the given attribute if the current user has :
|
|
Usage
Attribute Functions can only be used in a Federation configuration.
It can be applied to Name Id or Attributes in the Federation by selecting βFunctionβ as type in the drop-down icon.
![image-20240910-072114.png](../../__attachments/700416105/image-20240910-072114.png?inst-v=23d06e63-6973-4052-aaa5-c79093e792e5)
Then you can select the desired Attribute Function (among those configured for the tenant) in the Function list.
![image-20240910-072304.png](../../__attachments/700416105/image-20240910-072304.png?inst-v=23d06e63-6973-4052-aaa5-c79093e792e5)
The Attribute Function may requires some parameters you need to fill.
![image-20240910-072435.png](../../__attachments/700416105/image-20240910-072435.png?inst-v=23d06e63-6973-4052-aaa5-c79093e792e5)
Note that only configurable arguments are displayed but some fixed arguments may be hidden. So make sure to use the suitable Attribute Function.
Configuration
You can access the Attribute Functions configuration :
by clicking on "Access" β βAttribute Functionsβ
by clicking on "System" β "Configurations" β "Access Service " and perform an import/export.
Properties
The main configuration elements are :
Property name | Type | Mandatory | Description | Values (default value in bold) | Modifiable after creation |
---|---|---|---|---|---|
id |
| YES | The Attribute Function identifier. This identifier will be displayed in Function list in the Federation configuration screen. | - | NO |
name |
| YES | The Attribute Function name. | - | YES |
description |
| NO | The Attribute Function description. | - | YES |
arguments |
| YES | The list of input arguments for the Attribute Function. Two possible argument types :
| - | NO (except for unused Attribute Functions) |
builtinFunction |
| YES | The name of the built-in function to use | NO (except for unused Attribute Functions) | |
legacy |
| YES | Indicates if the Attribute Function is legacy . Built-in functions listed in this documentation are NOT legacy. | true, false | NO |
argument properties - Fixed
Property name | Type | Mandatory | Description | Values (default value in bold) | Modifiable after creation |
---|---|---|---|---|---|
value |
| YES | Two possible types :
|
| NO (except for unused Attribute Functions) |
Example
<maiaamcp:AttributeFunction id="TestFunction">
<name>Test Function</name>
<description></description>
<arguments>
<argument xsi:type="maiaamcp:FixedAttributeFunctionArgumentType">
<value xsi:type="maiaamcp:IdentityAttributeValueType">
<attributeId>firstName</attributeId>
</value>
</argument>
<argument xsi:type="maiaamcp:FixedAttributeFunctionArgumentType">
<value xsi:type="maiaamcp:ConstantAttributeValueType">
<value> </value>
</value>
</argument>
<argument xsi:type="maiaamcp:VariableAttributeFunctionArgumentType"/>
</arguments>
<builtinFunction>concat</builtinFunction>
<legacy>false</legacy>
</maiaamcp:AttributeFunction>
Reporting
You can see all applications using a specific Attribute Function in Reports, by using the Federation Mongo collection.
It can help if you want to delete an Attribute Function still in use in one or more Federations.