Developer / Reference / HTTP API

Authentication

Last updated on 13-May-2020 by Jakob Jakobsen Boysen
Jakob Jakobsen Boysen

Platform Lead
boysen@scifeon.com

If you are integrating directly with the Scifeon HTTP API it is recommended to use the PAT authentication method. For implementations with low security requirements, such as scripts and bots, it is also possible to use Basic authentication method.

Scifeon itself uses cookie-based authentication in the browser, so you can call the HTTP API from TypeScript on the page and rely on the authentication that the browser has established.

Personal Access Token (PAT)

This token can either by short-lived or long-lived.

Short-lived

The short-lived token is retrieved by requesting a token using the username and password:

The accessToken is valid for 20 minutes and can be used like this:

Long-lived

The long-lived token is generated in Scifeon here...

Basic authentication

Basic authentication works just as you would expect:

  1. Build a string of the form username:password
  2. Base64 encode the string.
  3. Supply an Authorization header with content Basic followed by the encoded string. For example, the string fred:fred encodes to ZnJlZDpmcmVk in base64, so you would make the request as follows: