The Shibboleth IdP V4 software will leave support on September 1, 2024.

ExpressionFunction

The bean named shibboleth.Functions.Expression executes a Spring Expression Language (SpEL) expression to implement an arbitrary Function signature.

The bean named shibboleth.BiFunctions.Expression 4.1 executes a Spring Expression Language (SpEL) expression to implement an arbitrary BiFunction signature.

An Expression Function is instantiated by supplying a string argument that contains a SpEL expression to evaluate.

Example

<bean id="MyFunction" parent="shibboleth.Functions.Expression" c:expression="#input + 42" />

Reference

The following additional bean properties are available:

PropertyName

Type

Default

Description

PropertyName

Type

Default

Description

customObject

Bean/Reference

 

An object to make available to the script via a variable named custom

returnOnError

Object

null

What to return if the expression fails

hideExceptions

boolean

false

If true, then the returnOnError value is returned if the expression raises an exception, otherwise the exception is passed out

inputType

(Function variant)

Class<?>

 

Adds type checking against the input to the function to enforce type safety

inputTypes

(BiFunction variant)

Pair<Class<?>,Class<?>>

 

Adds type checking against the input to the function to enforce type safety

outputType

Class<?>

 

Adds type checking against the output of the function to enforce type safety

For the Function variant, the expression environment will have these variables populated:

  • input - the function input

  • custom - the object set via the customObject property, if any

For the BiFunction variant, the expression environment will have these variables populated:

  • input1 - the first function input

  • input2 - the second function input

  • custom - the object set via the customObject property, if any