Authentication with long-lived token fails

Hi guys!

I’m running HA in docker on a RPi 4B with the following docker-compose.yml (HA part only):

    container_name: homeassistant
    image: ""
      - /mnt/sd/hass/config:/config:rw
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

I wanted to connect Rhasspy (also in a docker container) with my HA instance but the API access seemed to be unauthorised every single time. So I tried testing my token from command line (both from the RPi itself and from my laptop):

$ curl -X GET -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjYzhkZTQ0Y2JiMTQ0MGY2ODE0YWM0ZjViZDUyMzMzYyIsImlhdCI6MTY2ODM1ODcyMiwiZXhwIjoxOTgzNzE4NzIyfQ.Qr2IVeO8NwGppfV0G85yk_0teSm2MsQcqmZwM8w426A application/json" http://rpihass:9000/api/

Same result:

This is my configuration.yaml:

# Loads default set of integrations. Do not remove.

  server_port: 9000

# Load frontend themes from the themes folder
  themes: !include_dir_merge_named themes

# Text to speech
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

What am I missing? Is there anything else to configure to be able to be authorised by a long-lived token?

Thank you and best regards!

I have no clue why but it is working now…