-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API error "Unauthorized or unauthenticated." #10351
Comments
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. |
Did you try to get the api working with postman as described here?
|
Please post the curl command |
Hey, I've found a solution which to my knowledge is not mentioned in any thread: I had the same Issues, then upgraded to latest release, merged all changes from .env.example to my (3 years old) .env file and lowered the API_TOKEN_EXPIRATION_YEARS . Still nothing. After checking all dependencies there was only one thing left: The Apache Config. It seems I was preventing the loading of internal .htaccess file by using the alternate apache config provided in the install docs [https://snipe-it.readme.io/docs/linuxosx]. So going back to the default apache config was my fix:
|
Thank you! That really worked. Updating |
Debug mode
Describe the bug
I'm trying to query the API of our Snipe-IT instance for several days now but I cant get it to work.
My user has admin permissions and I created a token.
When I try to query the API via curl or powershell, I always get
{"error":"Unauthorized or unauthenticated."}
.I already decreased to API lifetime to 2 years as mentioned in other posts. I also get no errors in the php or apache log.
Reproduction steps
Expected behavior
Get returned values of API call
Screenshots
No response
Snipe-IT Version
5.3.1
Operating System
Ubuntu Server 20.04
Web Server
Apache
PHP Version
7.4.3
Operating System
Windows 11
Browser
No response
Version
No response
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
$ php -m [PHP Modules] bcmath calendar Core ctype curl date dom exif FFI fileinfo filter ftp gd gettext hash iconv json ldap libxml mbstring mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql Phar posix readline Reflection session shmop SimpleXML sockets sodium SPL standard sysvmsg sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl Zend OPcache zip zlib [Zend Modules] Zend OPcache
Additional context
No response
The text was updated successfully, but these errors were encountered: