Setting up OAuth2 Authentication for GOPACS APIs

Version: 10-06-2026

Introduction

To access GOPACS APIs, your application must authenticate using OAuth2 Client Credentials. This guide explains how to create client credentials and obtain an OAuth2 Bearer Token that can be used to call GOPACS APIs.

The process consists of two steps:

  1. Register your API client in GOPACS and obtain a Client ID and Client Secret.

  2. Use these credentials to request a Bearer Token from the authorization server.

The sections below explain each step in detail. For a video instruction (in Dutch), please check this explanation video.

General information about OAuth2 can be found here.

How to read the instructions?

The steps in the instruction manual are described in table form to clearly define the steps. The following columns are defined.

Column

Definition

Step

Order in which the steps are needed to be executed.

Description

Describes in detail what happens in the step.

Glossary

Is a term unclear? You’ll likely find its definition in our Glossary.

The English the glossary is located here: Glossary - GOPACS

De Nederlandse begrippenlijst vind je hier: Begrippenlijst - GOPACS

Other

More manuals can be found here: Manuals

If you need help or have questions, you can find our details here: Contact


Instructions

1 - Set up API Client Credentials

You only need to set up the client credentials once for the application that uses one of the GOPACS APIs.

Step

Description

1

Log in to the GOPACS UI (app.gopacs.eu) in your role as a Grid Admin or Trading Company Admin.

2

Navigate to ‘Organisations > API Clients’.

915cf4de-f195-4261-af7e-f9d75598402a.png

3

Click ‘+ Add’ to create a new API client.

4

Enter a unique name and select the roles you want to assign to the API client.
Depending on the assigned roles, you can restrict which actions an API client is allowed to perform.

5

After creating the API client, you will see a client key. For security reasons, this key is only shown once!

2 - Request an Access Token

Step

Description

1

To obtain an access token, authenticate with the OAuth2 authorization server using the Client ID and Client Secret obtained in Step 1.

The authorization server URL is listed in the table below.

This endpoint expects a POST request with the application/x-www-form-urlencoded content type and returns a JSON response.

curl -X POST "https://auth.acc.gopacs-services.eu/realms/gopacs/protocol/openid-connect/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=xxxxxx" \
-d "client_secret=xxxxxxxx" \
-d "grant_type=client_credentials"

2

In the response you’ll find an access token. This token can be used as authentication for the service.

{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSl...",
  "expires_in": 300,
  "refresh_expires_in": 1800,
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSl...",
  "token_type": "bearer",
  "not-before-policy": 0,
  "session_state": "a856fb91-eabc-460e-a54b-808c93acdc29"
}

3

Now, you need to read the access_token from this object and add it to the Authorization header of any subsequent request to any GOPACS API.

Authorization: Bearer <token>
Accept: application/json

4

From that moment on, your application uses this Bearer Token to authenticate with all GOPACS APIs for which the API client is authorized.