ansible-collections / servicenow.itsm

Ansible Collection for ServiceNow ITSM
GNU General Public License v3.0
87 stars 78 forks source link

Allow the inventory plugin to use an access token obtained by calling a custom URI #282

Open rnozaki opened 11 months ago

rnozaki commented 11 months ago
SUMMARY

In some environments, the access token is obtained by passing the user and password to a custom REST API. The purpose of this request is to enable the inventory plugin to also work when the authentication is done in this 2 step approach.

ISSUE TYPE
COMPONENT NAME

Inventory plugin.

ADDITIONAL INFORMATION
tupyy commented 6 months ago

What will be the use case for that? You can obtain an access key directly from SNow and use it in the playbook. We already support access_token.

rnozaki commented 6 months ago

AAP uses the inventory plugin from servicenow.itsm to read CMDB data from ServiceNow:

  1. Standard authentication methods always worked for this (user/password)
  2. Custom method is being requested as a new feature, because the customer has a proprietary method for generating their access tokens.

This issue is a request to allow such tokens to be obtained, when optional fields like the URL for the external call is passed, and then used in the remaining of the inventory logic.

The customer has even implemented the solution for this, but Tim was going to check if adding this feature to the collection would be allowed, as this is not applicable for all users.