Help! I lost access to my Instance due to Web serv... - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Hi there,

 

Ever lost your GUI access to your (Personal Developer) Instance? Because of activating the Web service access only checkbox on your User record? It could happen, and looking at several recent Community posts, I thought let's write down a simple solution. A solution that you can revert this change, without needing the Instance Help Community and ServiceNow employees to fix this for you.

 

Note: Best advice though would be, please DON'T work under the out-of-the-box System Administrator User on your (Personal Developer) Instance.


Web service access only

A short recap about the Web service access only checkbox on the User form lay-out, from the Docs:
"Non-interactive users can only connect to ServiceNow from an API protocol".

When having the Web service access only checkbox checked and trying to login to the GUI, you will be presented with:

 

find_real_file.png


Removing Web service access only

Reading the Docs again: "API protocol". That gives an idea. It's a bit tricky, though from another ServiceNow instance you might be able to execute a REST call to update the user record!

Code like below should update the web_service_access_only field. Code which I basically generated using the out-of-the-box REST API Explorer from ServiceNow. You can execute the through for example Background script.

 

(function() {

	var request = new sn_ws.RESTMessageV2();
	request.setEndpoint('https://your-instance.service-now.com/api/now/table/sys_user/6816f79cc0a8016401c5a33be04be441');
	request.setHttpMethod('PATCH');
	//Eg. UserName="admin", Password="admin" for this code sample.
	var user = 'admin';
	var password = 'admin';
	request.setBasicAuth(user, password);
	request.setRequestHeader("Accept", "application/json");
	request.setRequestHeader('Content-Type', 'application/json');
	request.setRequestBody("{\"web_service_access_only\":\"false\"}");
	var response = request.execute();

})();

 

1) Update the instance you are after in request.setEndpoint
2) The sys_id in request.setEndpoint should be the sys_id of the User record you are after, the sys_id currently displayed is the out-of-the-box System Administrator
3) Update var user and var password, with your User ID and Password


Result

After executing the above code through background script, the Web service access only checkbox will be unticked again. Login onto the GUI with the User account will be possible again.

 

find_real_file.png

---


And that's it actually! I do want to mention again, best advice: please DON'T work under the out-of-the-box System Administrator User on your (Personal Developer) Instance.

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

ServiceNow Technical Consultant @ Quint Technology
1x ServiceNow Developer MVP

1x ServiceNow Community MVP

---

LinkedIn

Comments
Kamini Kansal
ServiceNow Employee
ServiceNow Employee

Hi Mark,

Thank you for posting this. Users can also execute the rest api call using Postman if they do not have the second instance. 

Below is the code snippet for postman:-

Method:- PATCH

URl will be:- https://your-instance.service-now.com/api/now/table/sys_user/6816f79cc0a8016401c5a33be04be441 )


Headers:-Accept: application/json
Content-Type: application/json


Authorization: Basic (give username as "admin" and admin user password)


Body:- {"web_service_access_only":"false"}

Regards,

Kamini Kansal

Peru1
Tera Explorer

Its been really helpful, Thanks Mark!!

Chris H2
Mega Guru

Interesting problem, with a decent solution. In case someone doesn't have access to Postman or a 2nd developer instance: it is usually possible to run non-interactive REST calls like this directly from your browser's developer console; see the JavaScript (not ServiceNow) code snippet produced by REST API Explorer for an example.

Sadamo
Giga Explorer

Hello,

I am not able to request an instance after signing up.  I am stuck in the app engine studio. 

vmaladkar
Mega Explorer

 

Kamini Kansal this is great help using postman we can change SNOW user attribute values. The issue is resolved using your steps and able to login into admin UI now. Thanks to everyone for your inputs and knowledge share
Version history
Last update:
‎08-03-2024 06:46 AM
Updated by:
Contributors