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

Hello @Tanushree Maiti 

 

Yes, It was typo mistake for token URL.

I put my instance IP address in the Authorized redirect URLs in GLPI but still doesn't work.

 

Please try with correct scope as mentioned in the documentation.

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

martinvirag
Mega Sage

If you are using Postman as an example, do you recieve the Auth token through the same network the mid server resides on or is it accessible from the internet? You need to allow a property to make oauth through a mid, otherwise it will always fetch the token through the internet.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1645211

Also what you can try:
open the outbound http message logs and look for the actual authentication response message. For this one if the http log message is basic you need to modify 2 properties, the http log level override property (false to true) and the level itself to all , so you will see the actual message. 



Regards,
**Martin Virag**
ServiceNow MVP 2026