Versions Compared

Key

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

...

Expand
titleScript Context

As enumerated below, several variables are available in the template context.

Name

Description

response

Instance of HttpResponse to process

log

A class logger for debugging

custom

Custom object supplied via customObjectRef configuration attribute, if any

connectorResults

Pre-defined Set<IdPAttribute> variable to populate with output results

Unlike a lot of the scripted versions of objects across the system, there is no direct access to the ProfileRequestContext tree that exposes the state of the request. However, it's easy to get access to it by using a servlet request attribute named "opensamlProfileRequestContext". You can inject the servlet request object through the customObjectRef hook (set ; Set it to "shibboleth.HttpServletRequest" (or "shibboleth.HttpServletRequestSupplier" in V4.3 and later as per this link).

Example

The example illustrates a JSON-based web service. Some of the error handling in the JSON structure is elided, but it illustrates that the response data can be trivially turned into native Javascript objects with a couple of lines of code, and the rest is mechanical.

...