Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Unauthorized request with Authorization header - only works with access_token in body #2386

Open
michibertel opened this issue Jan 17, 2021 · 0 comments

Comments

@michibertel
Copy link

When sending any request to the API, I get the response:

{
    "error": {
        "code": 3,
        "message": "Unauthorized request"
    }
}

Although I set the Authorization Header like suggested: "Bearer TOKEN" (TOKEN can be the static token for the user or the response of a successful /auth/authenticate POST)

The strange thing is, it works when I send the token as "access_token" in the body of the request.

Like

{
    "access_token": TOKEN
}

This wouldn't be a big problem if the npm-package @directus/sdk-js would support this option.

Is there any workaround or fix for this issue?

Versions:

directus: 8.6.2
@directus/sdk-js: 6.2.0
MariaDB: 10.3

@michibertel michibertel changed the title Unauthorized request with Authorization Header - only works with access_token in body Unauthorized request with Authorization header - only works with access_token in body Jan 17, 2021
@rijkvanzanten rijkvanzanten transferred this issue from directus/directus Jan 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant