PhenixID

Syntax Attribute Validation

Version: 1.1

Category: Process

Extended Category: Session Attribute, Session Object

Action Package: Standard Actions

Description

Performs validation of session attributes (text, not binary, values)

Parameter

Description

Example

JSON Rules:

The set of rules, in JSON, to validate the objects against.

{
"attributeRules": [
{
"attribute": "test",
"regex": "^[a-zA-Z]+$",
"optionalAttribute": false,
"validateAllMultiValues": false,
"minimumMatches": 1,
"invertResult": false
},
{
"attribute": "username",
"regex": "^[a-zA-Z]+$"
}
]
}

Fail Action if Validation Fails:

[Optional] (true/false) Default value is true (fail on validation error).
If set to true:
The action will fail if the validation fails for at least one rule and object.
If set to false:
The attribute “SyntaxValidationError” will be populated with the attribute names of the attributes not complying with the validation rule. The action will not fail if the validation fails.

true

Validation errors attribute:

Name of the session attribute to write the validation errors to.
Default is “SyntaxValidationError”.

my-validation-attribute

Clear validation errors attribute:

Whether to clear the validation errors attribute on success or not.
Default is false (ie leave the value intact, which allows for chaining validation actions).

true

JSON Rules

  • The property “attributeRules” is an array. Each entry is an attribute rule.
  • Each attribute rule has the following properties:
    • attribute: Name of the session attribute to validate – must be provided
    • regex: The regular expression to validate the session’s value against – must be provided
    • optionalAttribute: true/false (false is default) – if validation will succeed if the attribute is missing
    • validateAllMultiValues: true/false (false is default) – in case there are multiple values, if validation must succeed for all values or not
    • minimumMatches: number (1 is default) – in case of multiple values, at least this many values must succeed validation
    • invertResult: true/false (false is default) – in case the session attribute exist, after having performed the validation, if this property is true, invert the result.
  • If any of the evaluated session attributes is a binary attribute, the attribute will fail validation (only text attributes are supported)

Use Cases

Example 1: Verify that the usernames are only a-z and A-Z

Will verify that all the username attributes exist, and that they are only a-z and A-Z, and if not, the action will fail.

Parameter

Value

JSON Rules:

{
"attributeRules": [
{
"attribute": "username",
"regex": "^[a-zA-Z]+$"
}
]
}

Fail Action if Validation Fails:

[BLANK]


DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.

The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.

PhenixID - support.phenixid.se