Download file from Apache directory listing

Hi!

I have setup a apache webserver and connected it successfully to auth0.
After login I am able to view the files in the browser.

Now I want to be able to download a file from the directory listing via a curl command.
How can I setup the machine2machine connection to be able to achieve this?
Or are there some other settings I have to do?

Basically I just followed the Quickstart example for Apache.

<Directory "/mnt/data">
    AuthType openid-connect
    Require valid-user
    Options +Indexes
</Directory>

I am able to get a bearer token (don’t know if this is necessary) with:

curl --request POST \
  --url https://dev-xxx.us.auth0.com/oauth/token \
  --header 'content-type: application/json' \
  --data '{"client_id":"xxx","client_secret":"xxx","audience":"test","grant_type":"client_credentials"}'

When I am trying to download the content of the file with:

curl --request GET \
  --url https://<IP>/secure/ \
  --header "authorization: Bearer $token"

I am getting a redirect:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://dev-xxx.us.auth0.com/authorize?response_type=code&amp;scope=openid%20name%20email&amp;client_id=asdf&amp;state=asdf&amp;redirect_uri=http%3A%2F%2F1.1.1.1%2Fsecure%2F&amp;nonce=asdf">here</a>.</p>

What am I doing wrong here?
Or can someone please point me to the documentation where I can find this?
Or is this just simply not possible?

Kind regards,
Daniel