oauth authentication issue

Jay81
Tera Guru

Configured oauth authentication between 2 service now instances. It is working for admin users. But getting below error for ITIL users. Please assist.

"com.glide.communications.ProcessingException: User Not Authenticated. OAuth token has expired or has not been retrieved."

 

1 ACCEPTED SOLUTION

vanishree
Kilo Guru

Hi,

Create table level "read" ACL on oauth_credential - to allow all user to access "Access Token"

View solution in original post

6 REPLIES 6

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

Can you check this as well once. We already have a knowledge article from Servicenow.

 

https://hi.service-now.com/kb_view.do?sysparm_article=KB0813794

 

Thanks,
Ashutosh

I saw the article but we can not give admin access to every user. Please find below business rule script I'm using to create HR case in oauth provider service now instance from another service now instance which consumes oauth token

 

var sd = current.short_description.getDisplayValue();
var sp = current.caller_id.getDisplayValue();
var hrService = '6628cde49f331200d9011977677fcf0b';
// var assignGrp = '9607daa413161bc07cf355912244b04b';
var state = '1';
var priority = '3';
var hrCase = new sn_ws.RESTMessageV2('create HR case', 'post');
var myObj = {

"short_description": sd,
"opened_for": sp,
"subject_person": sp,
"hr_service": hrService,
// "assignment_group": assignGrp,
"state": state,
"priority": priority

};

hrCase.setRequestBody(JSON.stringify(myObj));

var response = hrCase.execute();

var responseBody = response.getBody();
var jsonObj = JSON.parse(responseBody);
var responseNumber = jsonObj.result.number;

var httpStatus = response.getStatusCode();

gs.log('HR case response => ' + response);
gs.log('HR case response state => ' + httpStatus);
gs.log('HR case response body => ' + responseBody);
gs.log('HR case response number => ' + responseNumber);


current.work_notes = 'HR Case created for the work order : ' + responseNumber;

 

Hi,

End user need access to read that token which is not possible right now as it might be configured using Admin account. You might have to check those 2 acls mentioned in ACL and amend them.

Thanks,
Ashutosh

Himanshu Dubey
Giga Guru

Hi Jay,

 

Error is coming because user should have admin right to get OAuth token access.