Web API Authentication#

If the controller has an admin password or the current project has users configured under Web Interface Access, then some endpoints of the HTTP API and some functions in the JavaScript library will require clients to authenticate in order to authorise the requests.

Authentication Methods#

Two methods for authenticating users of the Web API are supported:

  • Cookie Authentication: the default when using the API and/or query.js library in a custom web interface.

  • Token Authentication: used with HTTP API requests, typically when the client is not a web browser.

With both methods, if the user is inactive for longer than 5 minutes then the cookie or token expires, requiring a username and password to be provided again.

Token Authentication#

Token authentication is typically used by the HTTP API in cases where a web browser is not the client. The client requests a Bearer Token with a POST request to the controller’s /token endpoint, providing the username and password, and this token is then used in future requests.