SPA controller

The SPA Controller is a node on Metrici which navigates the user to the SPA, either in an iframe or using a redirect. The SPA controller also acts as a web service endpoint which allows the SPA to retrieve a JWT which authenticates the user and which can be used to configure what the user is permitted to do. SPA controller is an extension of JWT Manager - see Security library.

The URL for the SPA will contain the following additional parameters:

  • tokenManager - the reference of the SPA controller, which acts as a JWT token manager.
  • rootPath - the root path of the Metrici instance.

In addition to the JWT fields, the SPA controller also provides:

Application URL URL at which the SPA can be found.
Run in iframe Indicates whether the SPA should be run in an iframe.
Iframe height

Controls the height of the iframe. This can be a fixed height, full the remainder of the containing page, or adjust the height to the iframe contents.

To adjust he height of the iframe contents, the SPA should include the following JS, where ${rootPath} is the path to your Metrici instance, e.g.

<script src="${rootPath}files/iframe-resizer/iframeResizer.contentWindow.min.js"></script>

Inherit from the SPA controller type into a normal node type to add additional fields to SPA controller, for example to add navigation to the page.