REST API call from remote instance using Basic Authentication fails

Marc Roy
Tera Guru

We've experienced an issue with an Inbound REST API call using Basic Authentication and known good credentials. I've unfortunately been unable to find existing post(s) that seems to match this particular scenario. 

  • Testing the account to login to the ServiceNow instance itself yields the expected: "Only interactive users are allowed to access UI"
  • When connection is attempted from a remote instance with previously configured details, we receive the following: 
  • {"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}

     

I have the same connection configured in a PDI for testing purposes and it reported the same issue and error as above. 

  • Resetting the password on the target instance has/had no effect.
  • What seems to resolve the issue is updating the credentials on the remote instance. 
    • Adding clarification, The connection starts working if I update the stored credential on the remote instance back to the same value that was previously stored. 
    • I'm attempting to determine what causes the stored credential to become invalid/stale, when it should still match the source credentials that have not been changed or expired. 

 

3 REPLIES 3

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi Marc,

Not too sure about the question. Is "non-interactive sessions" plugin installed and user setup to have "web_service_access_only" set to false?

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

The user has web_service_access_only set to True, and has rest_service role.

The user is used as part of rest transaction to update a staging table. 

The login from remote instance will fail until the password is reset on the remote instance. The password for the user is not modified or expired on the receiving instance. 

 

Are there any System Properties that affect stored Credentials? 

 

 

Ok, so I try to get remote access to the ServiceNow REST API working for Customer Service (CSM) basic information, Utah release,
and .. if you know it then it seems simple..

I found the ServiceNow doc reference which is quite good, like here for the Case API:
https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/case-api.h...

While troubleshooting on Auth errors, I concluded that I did read the SNow document to fast .. important here is the role 'csm_ws_integration' !

For now I ended up using below roles (note this is a CSM, Customer Service configured instance):
- csm_ws_integration
- sn_customerservice_manager  // needed this for some specific call's
- snc_readonly  // I hope this limits this remote user to read only access , not tested yet

 

Further I checked 'Web service access only' for the integration account.
Now testing .. so far seems to work good.