GLPI Oauth authentication to serviceNow

ArielN
Tera Contributor
 

Hi Eveyone, 

 

Has anyone implemented OAuth authentication between GLPI and ServiceNow?

 

Here is my configuration:

 

 

I created :

- A mid Server 

- A rest Message

 

HTTP Methods:

  • One method called "test" to initialize the session in GLPI using initSession.
    When I test this method, I receive a session_token, so it works correctly.

 

However, when I try to Get OAuth Token, I reach the authorization page.
When I click "Accept", I get the following error:

 

HTTP Error 401 - Unauthorized

--Screenshot 2026-03-16 160537.png

I also created an application Registry for the Get OAuth Token in the form with the necessary data/url for GLPI connection.

 

The grand type is "Authorization Code" for the registry and for OAuth Entity Profile.

 

After some analysis, it seems that when I click Get OAuth Token, the function does not work through the MID Server.

However, I’m not sure if this is the actual problem. If it is, I don’t know how to involve the MID Server when clicking Get OAuth Token.

 

Thank You for your Help

7 REPLIES 7

Tanushree Maiti
Kilo Patron

Hi @ArielN 

Share your Oauth_entity profile screen shot.

Also try with  grand type is "Client credential" .

Make sure Service account of GLPI having proper permission on that end.

 

Ensure - you are following this article: https://help.glpi-project.org/documentation/modules/configuration/oauth-clients

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Hello @Tanushree Maiti,

 

After trying with "client credential", I received this new error "OAuth flow failed. Verify the configurations and try again. Error detail:Invalid null response." I can not reach the page in GLPI.

 

Here is my Oauth_entity profile

 

Screenshot 2026-03-18 170629.png

 

Regarding the application registry:

Default grant type is "Authorization Code"

Authorization URL is http://xxxxxxx/api.php/authorize

Token URL is http://xxxxxxx/api.php/tokne

 

Redirect URL : https://my-instance.service-now.com/oauth_redirect.do

Send credentials is "As Basic Authorization Header"

 

In GLPI , I created an OAuth Client, grants "All", Scopes "Api". 

In Authorized redirect URLs  https://my-instance.service-now.com/oauth_redirect.do

 

 

Hi @ArielN 

 

in token url , is it typo mistake or in setting this error is there

Token URL is http://xxxxxxx/api.php/tokne

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Hi @ArielN 

 

Also two things. 

Make sure servicenow IP has been added at GLPI end as authorised IP address

 

in document it is mentioned "inventory" scope needs to add.

 

Ensure, it is done.

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: