3. Security and Validation

expressionExtractor

Extracts an API key by evaluating an expression on the incoming request. The result (a string) is treated as the API key. The expression is evaluated in the configured language (default: {@code SPEL}) during the request flow.

Typical usage inside {@code <apiKey>}:

 <apiKey>
   <expressionExtractor
       language="SPEL"
       expression="request.headers['X-Api-Key']"/>
 </apiKey>
 

If the expression evaluates to {@code null} or an empty string, no key is extracted.


Can be used in:

apiKey and bean