You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-12-16 18:51:38

fneto
Member
Registered: 2013-11-06
Posts: 6

GLPI API Always returning login page

Hi everybody, how are you?

I'm facing a difficult with GLPI API, I'm using it for the first time.

I have enabled API on Setup -> General -> API (and enabled the login with external app token)
Create an API client with my source IP address and generate the app_token (the user is enabled)
Create an user in GLPI and generate the personal token and API token

I've checked the Setup -> General -> System and all plugins and php requirements are ok

My GLPI version is 10.0.5
Linux version Ubuntu LTS 22.04
Web Server Nginx

My GLPI installation in on URL root ex: https://my-glpiserver.com.br

My API URL is https://my-glpiserver.com.br/apirest.php

My access string is:
curl -X GET -H 'Content-Type: application/json' -H "Authorization: user_token <personaltoken>" -H "App-Token: app_token-generated on api user" 'https://my-glpiserver.com.br/apirest.php/initSession'

But testing it on curl or postman always return the full GLPI login page and never an authorization success or error

By the way, if I a access the API URL without any parameter ir returns the API documentation normally.

I really don't know what else I could look for, so if anyone have any tip about what is wrong or what I should verify I will be very appreciated!

Offline

#2 2022-12-19 10:35:03

Kaya84
Member
Registered: 2019-06-13
Posts: 196

Re: GLPI API Always returning login page

Offline

#3 2022-12-19 20:04:45

fneto
Member
Registered: 2013-11-06
Posts: 6

Re: GLPI API Always returning login page

I've read the topic that you suggested but I think it isn't suitable for me, because my problem is not an authentication error, my problem is that API didn't respond as it should.

It seems that the normal login page returns in place of the API. I think it could be some misconfiguration in nginx because I've tested in another server with same Linux and Ngin'x configuration and the problem repeats.

I will try to setup a Linux server with apache to test it!

Offline

Board footer

Powered by FluxBB