{{warning}}

Security Options

Security options are set in the Player Token.

secure

The secure option provides some support for preventing answers or scores being sent down to the client. If used, this option should be passed when creating a token.

    POST  https://platform.corespring.org/player/encrypt-options
    {
      "secure": true
    }

Setting secure to true will disable certain functionality in the Item Player API:

  • mode cannot be changed to evaluate with setMode() if the server-side item session is not marked as complete
  • mode cannot be changed to instructor with setMode() if the server-side item session is not marked as complete
  • mode cannot be changed to gather with setMode() if the server-side item session is marked as complete
  • getScore() will not work unless the server-side item session is not marked as complete

Using the secure option requires a call to `completeResponse()`` to indicate the final response has been submitted. It is important ot note that a session may be 're-opened' using the REST API if needed (See Item Sessions).

expires

To expire a player token after a certain time period, pass an expires property when creating the player token. The token will only work until the expiry time specified.

The expiry time is provided as a date in Unix time: the number of seconds from 1970-01-01T00:00:00Z UTC. If the expiry time property is not specified, the player token will not expire.