elonsoc / ods

An API provider that gives Elon University students access to university data.
https://ods.elon.edu/
1 stars 3 forks source link

[backend] Bearer <token> 401's on Correct Token #50

Closed jumarmartin closed 6 months ago

jumarmartin commented 7 months ago

Following the usage guide on authentication to make a call to the api requires the header Authorization: Bearer <API_KEY>. When supplying it, I get a 401.

It seems like if we don't supply "Bearer" (which we should) then it works!

Reproduction

Run the following with a proper api key: curl -X GET https://api.ods.elon.edu/ping -H "Authorization: Bearer <VALID_API_KEY>"

We should get an empty body with a 200. Instead, we get a 401.

When running the same curl command without "Bearer" in the header, we get the 200:

curl -X GET https://api.ods.elon.edu/ping -H "Authorization: <VALID_API_KEY>"

When ran in Insomnia:

image image
ejrcarr commented 6 months ago

Updated documentation as a quick fix, but will look into it today

ejrcarr commented 6 months ago

Done