Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

API Key is not working #512

Closed
jimbobbennett opened this issue Feb 6, 2024 · 4 comments
Closed

API Key is not working #512

jimbobbennett opened this issue Feb 6, 2024 · 4 comments

Comments

@jimbobbennett
Copy link

Not sure if this is the right repo for this - I generated an API token following the docs, and I'm still getting unauthorized when I call the API.

image
@nickytonline
Copy link
Member

nickytonline commented Feb 6, 2024

Hmmm, my coworker @brandonroberts did a quick the and the token generated works with https://api.opensauced.pizza/#/Authentication%20service/checkAuthSession

@jpmcb
Copy link
Member

jpmcb commented Feb 6, 2024

This is working for me:

curl -X 'GET' \
  'https://api.opensauced.pizza/v2/auth/session' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <redacted>'

where I grabbed my token from the hot.opensauced.pizza "Print auth token" method.

A few things to note:

  • these JWT expire after short period of time (like 20 minutes) as they are only session tokens and do not automatically refresh from manual use via curl, postman, or another 3rd party API client. So, if this is a stale token, I'd try getting a new one and using that.
  • Did your 3rd party application include Bearer in the authorization header? It'd be helpful to see the raw query it attempted to make (where your token is redacted).

@jimbobbennett
Copy link
Author

Well found the issue...

It seems if I generate the token with Safari, it's not valid and I get a 401. If I use Edge it works.

Looks like Safari is truncating the API Key in the console output. There's a .<something> on the end of the key that Safari is losing.

Maybe something to add to the docs? I'll close this issue for now, thanks @nickytonline and @jpmcb

@nickytonline
Copy link
Member

I'll go ahead and create an issue for that. Thanks @jimbobbennett!

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

3 participants