Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Nashorn plugin provides support for the Nashorn JavaScript engine for IdPs of version 4.1 and beyond. This the scripting engine that was shipped with Java between versions 8 to 14 (it is not present as of JDK15).  It is therefore targeted at IdP installations on JDK 15 and laterThe plugin uses the Nashorn scripting engine provided by the OpenJDK project.

Installation

Info

Starting with IdP 4.2 you can the install the latest plugin version supported on your IdP version with
.\plugin.sh -I net.shibboleth.idp.plugin.nashorn

...

This is a collection point for any “generic” scripting tips or examples that don’t pertain to specific use cases but just illustrate harder or non-obvious ways to use Javascript in the Java environment.

Setting ‘nashorn.args’

In JDK11 you set arguments to the Nashorn scripting engine via the nashorn.args system property

Code Block
-Dnashorn.args=--no-deprecation-warning

It appears that this mechanism has changed in new versions and you need an extra level of indirection

Code Block
-Dnashorn.args=-D--no-deprecation-warning

Debugging issues with the Nashorn Scripting Engine

The engine can fail (and indeed fail to load) silently. To debug this (not your script itself) you can set the nashorn.debug system property to “true”.

Accessing Classes or Static Methods

...