How to install
==============

Put the content of `plugins` in the `plugins` directory of your SquashTM installation.

Do not forget to remove the old version of this plugin if it was already present in your SquashTM.

Requirements
============

OpenProject 17.2 or later.

This connector authenticates with an API token sent as a bearer token, which OpenProject only
accepts from version 17.2 onwards, and only for tokens generated on 17.2 or later. An older
server, or a token generated before 17.2, does not recognise the header: testing the credentials
then fails without indicating that the version is the cause.

Create the token from your OpenProject account settings, under "Access tokens" / "API tokens", then
paste it into the credentials of the OpenProject server in SquashTM's administration.

OAuth2
======

As an alternative to the API token, the server can authenticate through an OpenProject OAuth
application (Administration -> Authentication -> OAuth applications), either for each SquashTM
user, redirected to OpenProject, or as the application itself through the OAuth 2.0 client
credentials grant.

Create the application with the callback URL displayed in the SquashTM server form as its
redirect URI, and the `api_v3` scope. For the client credentials grant, tick "Confidential" and
choose the "Client Credentials User": every call made by SquashTM is then performed as that user,
so give it the permissions the projects need. Then, in SquashTM, select the OAuth 2.0 protocol,
the "Client Credentials" grant type, and paste the client ID and client secret. SquashTM requests
the token when the configuration is saved and refuses it if OpenProject does.

Reporter of the created work packages
=====================================

OpenProject records, as the author of a work package, the account behind the credentials of the
call that created it. With the OAuth 2.0 authorization code grant that is the SquashTM user who
declared the issue; with an API token it is the account that generated the token.
