This is an old revision of the document!


API-Tokens

For an external application to connect with Stages, it needs a way to authenticate itself. This can be done with API-tokens.

Server configuration / Setting the Token secret

Stages generates its API tokens on the basis of a unique secret that can only be set by the Stages administrator. This should be a random string value with at least 32 characters. This value should be stored in the file conf/secret.properties like this:

apitoken.secret = <value>

In the conf/config.xml file the following configuration property needs to be declared:

<property name="restapi.apitoken.secret" value="${apitoken.secret}"/>

After that, a service restart is necessary.

How to create an API token for SCIM

Users need to have READ and CREATE permissions on the API tokens permission domain to be allowed to create API tokens . In order to revoke API tokens, READ and DELETE permissions are required. Authorized Stages users can find and manage the API tokens under Administration > SCIM API.

Each token is identified by a label that is defined upon generation. The resulting token values will not be stored at the server but the server is able to identify a valid token by its value. Tokens become invalid after explicitly being revoked by the Stages administrator or after their expiry date has been reached.

Directly after creating the API Token, the token value can be copied from the Stages popup dialog and saved in a secure location. Once the dialog has been closed, it can not be retrieved anymore.

Requests to the Stages REST endpoint must contain the value of a valid API token in the Authorization header in the following format: Bearer <token_value> Typically, the identity providers do this under the hood. All actions will be logged at the server in the scim.log and audit-json.log files with the respective API token label as a logging context identifier.

How to create an API-token for the REST API

The REST API is only accessible for Process Modellers with CollectorData Read and Create permissions.

Such a user is also allowed to create an API-token for this API. This can be done in the user settings page (click on the username in the left navigation) in the section Security and Privacy.

Directly after creating the API Token, the token value can be copied from the Stages popup dialog and saved in a secure location. Once the dialog has been closed, it can not be retrieved anymore.