The identityServer
variable
Identity Cloud provides an additional variable, named identityServer
, to scripts. You can use this variable in several ways. The ScriptRegistryService
, described in Validate scripts over REST, binds this variable to:
-
getProperty
Retrieves property information from system configuration files. Takes up to three parameters:
-
The name of the property you are requesting.
-
(Optional) The default result to return if the property wasn’t set.
-
(Optional) Boolean to determine whether to use property substitution when getting the property.
For example, you can retrieve the value of the
openidm.config.crypto.alias
property with the following code:alias = identityServer.getProperty("openidm.config.crypto.alias", "true", true);
The following REST call returns the value of an ESV (Environment Secret and Variable):
curl \ --header "Authorization: Bearer *token*" \ --header "Accept-API-Version: resource=1.0" \ --header "Content-Type: application/json" \ --request POST \ --data '{ "type": "text/javascript", "source": "identityServer.getProperty(\"esv-myvariable_1\")" }' \ "https://<tenant-env-fqdn>/openidm/script?_action=eval"
-
-
getInstallLocation
Retrieves the Identity Cloud installation path, such as
/path/to/openidm
. May be superseded by an absolute path.