ServiceNow Basic Authentication - Unauthorized

Describe the problem/error/question

Hello,
When I’m trying to create a new credential for ServiceNow using Basic Authentication, I get the following message: Unathorized
I tried with a couple of valid accounts. They work fine in Postman using the same authentication method.
I noticed the same issue on my local instance and n8n Cloud.

What is the error message (if any)?

Unauthorized

Please share your workflow

There is no workflow yet. This is related to credentials.

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:1.0.5 (fresh install with npx)
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm, n8n cloud
  • Operating system: Mac OS, Cloud

I have made some progress and would like to share more information on the topic.
I was able to log in with an admin account and that works fine.

However, looking at the source code, it appears that the ServiceNow user needs to be able to access the sys_user_role table (https://github.com/n8n-io/n8n/blob/eeb49e9375f34fc1a757719ee4a659978c141e93/packages/nodes-base/credentials/ServiceNowBasicApi.credentials.ts#L58).

I’m afraid my API account (not the admin one) only has access to the incident table I was going to read.
Is it possible to skip the sys_user_role verification on the Basic Auth or replace it with another table (e.g. incident)?

I have the same issue, a locked down set of credentials that fails the check but still works when using the correct tables. You can safely ignore the check.

I tried to update the credentials check but unfortunately there’s just no generic SNow endpoint that any/all users/credentials can hit. Usually most APIs will have a /me or /user endpoint.

3 Likes

Thanks! I initially avoided trying it due to the error on the credentials page, but it turns out that it still functions properly as long as the account has access to the table being queried.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.