Various custom configuration elements support a common content model used to supply JSR-223 scripts inside other object configurations. Where applicable, the specific configuration elements that share this content model will link to this page. These include the following documentation pages:
...
Excerpt | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AttributesAn element of type
If the Child ElementsAn element of type
The script may be stored in a local file (with
|
...
The default scripting language is JavaScript (language=”javascript”
). Therefore all of the sample scripts are written in JavaScript, which is based on the ECMAScript standard. The following table illustrates the relationship between JRE version and ECMAScript version:
JRE Version | Default Script Engine | ECMAScript Version |
Java 7 | Rhino | ECMAScript for XML (E4X) |
Java 8 | Nashorn | ECMAScript 5.1 (June 2011) |
Java 9 | Nashorn | ECMAScript 5.1 (plus some features of ECMAScript 2015 aka ECMAScript 6) |
Since Java 7 reached end-of-life on April 2015, we assume Java 8 or above, and therefore the sample scripts aim to conform to ECMAScript 5.1. which implements Nashorn.
Info | ||
---|---|---|
| ||
An introduction to Nashorn from Oracle: Part 1: Introducing JavaScript, ECMAScript, and Nashorn |
If you’re still using Rhino, the sooner you migrate to Nashorn, the better. That said, many of the sample scripts (which are quite simple) will run under both Rhino and Nashorn.
Info | ||
---|---|---|
| ||
If you’re still using Rhino, the sooner you migrate to Nashorn, the better. Consult the Rhino Migration Guide and this Java 8 Nashorn Tutorial for helpful advice for helpful advice. |
Since Nashorn is included with Java 8 (and later), the sample scripts aim to conform to ECMAScript 5.1. In particular, the scripts avoid features introduced in ECMAScript 6 (also known as ECMAScript 2015) for compatibility.
Note | ||
---|---|---|
| ||
Language features introduced in ECMAScript 2015 (aka ECMAScript 6) are intentionally not used in the sample scripts for compatibility reasons. This includes let , const , and the so-called fat arrow function notation. |
...
Note | ||||
---|---|---|---|---|
| ||||
The JSLint tool cannot tell that the JavaScript is being run within the environment of the IdP, with the implied inputs and outputs that that infers. This manifests itself in two ways:
|